1. Flux Charts
    2. SFX Backtester

    SFX Backtester: Exit Conditions

    SFX Backtester Exit Conditions

    The SFX Backtester allows users to create and backtest strategies using features from the SFX Algo Toolkit. This article covers the various conditions and rules for exiting positions in long and short entries.

    Exit Conditions

    Exit on Opposite Signal

    SFX Backtester Exit on opposite signal setting

    When enabled, a long position will close when short entry conditions are met, and a short position will close when long entry conditions are met.

    Exit on Session End

    SFX Backtester Exit on session end setting

    When enabled, positions will be closed at the end of the trading session of the selected ticker.

    Take Profit Conditions

    There are several methods available for setting take-profit exits and conditions.

    TP Condition 1, 2, 3

    The SFX Backtester lets users set up to three distinct Take Profit (TP) levels within a strategy, enabling the creation of customized TP conditions. With TP Conditions 1, 2, and 3, you can use the same Entry Conditions that your strategy is based on as triggers. These options are found below the long and short exit conditions within the settings.

    Users can also customize the % of their position that exits the trade when the TP condition is triggered. The sum of the % across all the TP conditions used must add up to 100. For example, if TP Conditions 1 and 2 are used, you could set TP 1 to 70% and TP 2 to 30%.

    Below is an example of three TP conditions being used with 50% of the initial position exiting when TP 1 is triggered, 30% when TP 2 is triggered, and the remaining 20% when TP 3 is triggered. The TP triggers for TP 1, 2, and 3 are set as a retest of a bullish retracement wave.

    SFX Backtester TP Condition 1, 2, and 3 example

    Fixed TP

    SFX Backtester Fixed TP setting

    Users can set a fixed TP for exits. This setting can be found under the long and short exit conditions. Users can choose between the following:

    Price: This method triggers a TP exit when price reaches a specified level.

    For example, if you set the Price TP to 5 and buy $NVDA at $125, the trade will automatically exit when the price reaches $130 ($125 + $5).

    Ticks: This method triggers a TP exit when price moves a specified number of ticks.

    Percentage (%): This method triggers a TP exit when price moves a specified percentage.

    ATR: This method triggers a TP exit based on a specified multiple of the Average True Range (ATR).

    Stop Loss Conditions

    There are several methods available for setting stop-loss exits and conditions.

    Entry Condition SL

    Users can use entry conditions as triggers for stop-loss exits. This setting can be found under the long and short exit conditions.

    Here is an example of a stop-loss exit being set to trigger once a bearish signal is detected.

    SFX Backtester SL Condition setting

    Fixed SL

    SFX Backtester Fixed stop loss (SL)

    Users can set a fixed SL for exits. This setting can be found under the long and short exit conditions. Users can choose between the following:

    Price: This method triggers a SL exit when price reaches a specified level.

    For example, if you set the Price SL to 10 and buy $AMZN at $150, the trade will automatically exit when the price reaches $140 ($150 - $10).

    Ticks: This method triggers a SL exit when price moves a specified number of ticks.

    Percentage (%): This method triggers a SL exit when price moves a specified percentage.

    ATR: This method triggers a SL exit based on a specified multiple of the Average True Range (ATR).

    Trailing SL

    To use a trailing SL, set the Fixed SL input to 'Trailing'. The trailing stop-loss value entered is measured in ticks.

    SFX Backtester Trailing Stop Loss

    If you want to only activate the Trailing SL after a certain number of ticks, you can adjust the 'Trailing Stop Activation' setting.

    SFX Backtester Trailing Stop Loss activation setting

    In this example, an 80-tick trailing SL is triggered once price moves 20 ticks in the intended direction.

    SFX Backtester trailing stop loss example

    If you want to use a fixed SL alongside a trailing SL, enable the Hard SL setting. This option is only applicable when the trailing SL is active.

    SFX Backtester Hard SL setting

    Move Stop Loss to Breakeven

    This setting allows the strategy to automatically move the SL to Breakeven (BE) when the position is in profit by a certain amount. Users can choose between the following:

    • Price: This method moves the SL to BE when price reaches a specified level.

    • Ticks: This method moves the SL to BE when price moves a specified number of ticks.

    • Percentage (%): This method moves the SL to BE when price moves a specified percentage.

    • ATR: This method moves the SL to BE when price moves a specified multiple of the Average True Range (ATR).

    • Long TP 1: This method moves the SL to BE when TP Condition 1 is triggered. This method only works if TP Condition 1 is being used.

    • Long TP 2: This method moves the SL to BE when TP Condition 2 is triggered. This method only works if TP Condition 2 is being used.

    • Long TP 3: This method moves the SL to BE when TP Condition 3 is triggered. This method only works if TP Condition 3 is being used.