Strategy Elements


Specifies one or more conditions that would trigger a position exit


Any formula specifying a true/false condition (non-zero means true)


The ExitRule for a strategy is evaluated for every position every day. If it ever returns true (non-zero), the position is exited either that day at the close or the next day at the open, depending on the ExitTime setting.

When exit time is AtOpen (the default), ExitRule is evaluated using the day prior to exit day as the most recent bar in the formula. For AtClose exits, the exit day is the most recent bar.

This formula is typically used to specify a conditional exits such as C > C[1], or time-based exits such as BarsHeld==10.

A strategy can include any combination of an ExitRule, ExitLimit (target) 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.

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




Copyright © 2020-2021 Systematic Solutions, LLC