Navigation: Realtest Script Language > Syntax Element Details >







Strategy Elements


Specifies when a strategy enters new positions


ThisClose - entries occur at the close of the current day

Intraday - entries occur when a trigger price is first touched tomorrow (default for limit and/or stop orders)

NextOpen - entries occur at tomorrow's open (default for market orders)

NextClose - entries occur at tomorrow's close


Using ThisClose implies an ability to generate realtime trading signals using live data. RealTest will not be able to generate Tomorrow's Orders for ThisClose entries.

For strategies with no EntryLimit or EntryStop, EntryTime controls the time at which a market order is generated. NextOpen implies that a standard MKT order is placed before the open, to be filled at the open. (Intraday is interpreted as NextOpen for market orders.) NextClose implies that a MOC order is placed before the open, to be filled at the close.

EntryTime also applies to strategies that use an EntryLimit and/or EntryStop price.

Using ThisClose entry with EntryLimit specified is equivalent to adding "and C < n" to EntrySetup (for a long-side strategy) where "n" is the EntryLimit price. Similarly, a long EntryStop would be equivalent to "and C > n". Reverse these comparison operator directions for short-side strategies. As previously stated, orders cannot be generated in advance for this mode.

With Intraday, NextOpen, or NextClose limit or stop entries, the trigger price is calculated using the prior bar, and the order can be placed in advance.

A Intraday EntryLimit or EntryStop is a standard LMT DAY or STP DAY order.

A NextOpen EntryLimit is a LMT OPG order, and a NextOpen EntryStop is STP GTD 9:31 EST.

A NextClose EntryLimit is a LOC order, and a NextClose EntryStop is STP GAT 15:58 EST.

In all of the above, if both EntryLimit and EntryStop are specified, the order becomes STPLMT with the same qualifiers.

(All of the above order types are stated using Interactive Brokers order nomenclature, and can be automatically generated by adding TestOutput: Orders and OrdersTemplate: Examples\ib_basket_trader.csv to your Settings.)

For more information on how the backtest engine works in general, see Backtest Engine Details.




Copyright © 2020-2024 Systematic Solutions, LLC