Category
Strategy Elements
Description
Determines whether a stock is eligible for entry
Input
Any formula specifying a true/false condition (non-zero means true)
Notes
EntrySetup is the first formula evaluated for each stock on each date of a backtest. If the return value is non-zero (true) then the stock is set up for entry (is an entry candidate). If a strategy has no EntrySetup formula, then it will produce no trades (unless it uses an Imported Trade List).
If a strategy also includes an EntryLimit and/or EntryStop formula, or if it specifies EntryTime as NextOpen (or leaves it unspecified), then all entry-related formulas including EntrySetup are evaluated using the day prior to entry day as the most recent bar in the formula. The only case where the entry-day bar can be accessed in entry-related formulas is when none of those things are true, i.e., when the strategy models entry with a market order just before the close.
For more information on how the backtest engine works, see Backtest Engine Details.
EntrySetup formulas can, at times, be rather complex. For this reason, it is highly recommended to make use of the Data Section for most of your entry condition logic. I will often have a series of data items that feed into a final one called something like "IsSetup", then just use EntrySetup: IsSetup.
The mr_sample.rts sample script includes an example of this tactic:
|