Navigation: Realtest Script Language > Syntax Element Details >







Strategy Elements


A price at which to exit a position using a limit order (profit target)


Any formula specifying a price per share


ExitLimit specifies a "target" price, implemented by default as a LMT DAY order. The formula is re-evaluated each day, so it can function as either a static or moving target, depending on how it is specified.

ExitLimit is always evaluated using the day prior to exit day as the most recent bar in the formula.

A simple fixed 5% profit target could be specified as FillPrice * 1.05 for a long position or FillPrice * 0.95 for a short position.

An ATR-based target might be expressed as FillPrice + 2 * ATR(14) for a long position or FillPrice - 2 * ATR(14) for a short position.

A strategy can include any combination of an ExitRule, ExitLimit and/or ExitStop (stop-loss). Whichever one is determined to have occurred first will be the one used in the test. The type of exit that occurred for each trade is displayed in the Reason column of the Trade List.

See also ExitLimitTime for other target-order alternatives.

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




Copyright © 2020-2024 Systematic Solutions, LLC