Category
Strategy Elements
Description
Price to use when entering a position with a limit order
Input
Any formula specifying a price per share
Notes
The price returned by the EntryLimit formula is used to place a oneday 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 stopbased entry strategy where the opening gap is excessively large.
When a strategy includes an EntryLimit and/or an EntryStop formula, all entryrelated formulas are evaluated using the prior day as the current bar, so that there can be no possibility of a lookahead 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).
Examples
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)
