Navigation: Realtest Script Language > Syntax Element Details >







Strategy Elements


Price to use when entering a position with a limit order


Any formula specifying a price per share


The price returned by the EntryLimit formula is used to place a one-day limit order. For a long buy, the Low must be less than or equal to the limit price to potentially generate an entry. For a short sale, the High must be greater than or equal to the limit price.

If the opening price for a stock is at or beyond the limit price, then the the order is assumed to have been filled at the opening price, otherwise it fills at the limit price. Limit orders that fill at the open are assumed to have filled first when some entries have to be skipped due to position count or investment level caps.

If both EntryLimit and EntryStop are used, then the entry order becomes a stop+limit order. For this order to fill, both of these prices must be touched. The most common reason to use a stop+limit order is to avoid entries in a stop-based entry strategy where the opening gap is excessively large.

When a strategy includes an EntryLimit and/or an EntryStop formula, all entry-related formulas are evaluated using the prior day as the current bar, so that there can be no possibility of a look-ahead error. EntrySetup is evaluated first, and no other entry formulas are evaluated if it returns 0. (The only exception is when EntryTime is ThisClose, which implies that a live data feed would be used to enter just before the close.)

If the EntryLimit formula returns 0, this means "always enter", i.e., it becomes a market order (or a simple stop order if EntryStop was also specified).


Enter long when price drops 4% below yesterday's close: EntryLimit: C * 0.96

Enter short when price touches an upper Bollinger Band: EntryLimit: BBTop(20, 2)

Enter long when RSI(2) reaches 5: EntryLimit: RRSI(2,5)





Copyright © 2020-2024 Systematic Solutions, LLC