Support

Equilla Formula Language

IsInSession

Checks if a date and time value is in the trading sessions specified for an instrument.

Inputs

Datetime
Numeric: The Date and time value to check.

Remarks

You may customize the trading sessions of an instrument via the Session Manager.

Examples

Buy on the first bar of a day and exit on the last bar
If TimeBase >;= 86400 Then RaiseRuntimeError( "Please select an intraday period in order to run this strategy!" ) Else If TimeBase <;= 0 Then RaiseRuntimeError( "This strategy does not work with tick data!" ); If IsInSession( DateAdd( Interval_Second, 2 * TimeBase, DateTime ) ) Or IsOutOfSession( DateAdd( Interval_Second, TimeBase, DateTime) ) Then Buy Else Sell;