Backtesting Concepts

Re-entering After an Exit

What happens when a trade closes while the entry rule still holds, and when to wait for a fresh entry signal instead.

Re-entering After an Exit

Your entry conditions say when to open a trade. They do not say what should happen when a trade closes while those conditions are still true. Simula gives you a choice, set by the Wait for a fresh entry signal after an exit checkbox under your entry conditions.

Off (the default)
After any exit, a new trade can open as early as the next candle, as long as your entry conditions are true, even if they stayed true through the whole trade and past its close. This is how code-based platforms behave unless you write extra logic to prevent it.
On (wait for a fresh signal)
After an exit, your entry conditions must be false on at least one candle, counting the candle that triggered the exit, before a new trade can open. The signal has to switch off and on again.

Why It Matters

Take an entry rule of RSI below 25 with a 1% stop loss. During a sell-off RSI can stay below 25 for many candles. With the default, if RSI is still below 25 when the stop loss closes the trade, the strategy can buy again on the next candle. One sell-off can produce a string of stopped-out trades from what you think of as a single signal.

If your idea is "buy once when RSI drops below 25", those repeat entries are not the strategy you meant to test. If your idea is "be long whenever price is above the 200-period EMA", repeat entries are exactly right: a take profit should not keep you out of a trend your rule says you should be in. The setting lets the backtest match the idea.

How It Works

The setting looks at your combined entry rule: the single true or false the engine computes on each candle after combining every entry condition with your AND / OR logic and groups. It does not look at conditions one by one.

Entry ruleDefaultWait for fresh signalfalse0true1true2true3true4true5true6true7false8true9true10true11stop loss
Entry rule "RSI below 25", fills at the candle's close. Triangles pointing up are entries; the one pointing down is the stop loss. Candle numbers are along the bottom.

In the picture, the first trade opens on candle 1 and a stop loss closes it on candle 4. The rule is still true on candle 4, so with the default a new trade opens on candle 5. With the setting on, the engine waits: candles 5, 6 and 7 do not count because the rule is still true, the rule is false on candle 8, and the new trade opens on candle 9 when the rule turns true again.

Three cases

The same rule, RSI below 25, with a stop loss closing the trade:

What RSI didDefaultWait for a fresh signal
Stayed below 25 for the whole trade and after the stop lossRe-enters as early as the next candleWaits until RSI goes above 25 and back below
Went above 25 during the trade, but was below 25 when the stop loss closed itRe-enters as early as the next candleWaits the same way: only candles from the exit on count, so the reset during the trade does not
Was already above 25 when the stop loss closed the tradeEnters when RSI next drops below 25The same

The rule applies after every kind of exit: an exit condition, a stop loss, a take profit, a trailing stop, a break-even stop, a time exit, and the end-of-day close on intraday stock backtests.

The first candle counts as an exit

With the setting on, the first candle of a backtest is treated as if a trade had just closed on it. If your entry rule is already true on that candle, the backtest waits for the rule to turn false and then true again before its first trade. The reasoning is the same as after an exit: a rule that was already true when the backtest started is not a fresh signal. With the default, a rule that is true on the first candle triggers a trade right away.

Which candle is the exit candle

The exit candle is the candle that triggered the exit. For a stop loss, take profit, trailing stop or break-even stop, it is the candle whose price range reached the level. For a time exit or the end-of-day close, it is the candle the trade closed at. For an exit condition, it is the candle whose close made the condition true -- with the default next-open fill the trade then closes at the next candle's open, but the candle that decided the exit is still the one that counts.

That matters when the market whipsaws. Suppose price crosses below a moving average on one candle, which fires your exit, and crosses back above it on the next. Your entry rule was false on the candle that triggered the exit, so the cross back above is a fresh signal in both modes.

Why crossovers barely change

A crossover is true only on the one candle where the cross happens. On the candle after a cross it is false again, so the wait ends almost as soon as it starts, and the next cross opens a trade in both modes. An entry rule that is a single crossover, or crossovers joined by AND, gets the same trades either way, with two exceptions:

A cross on a candle where a stop closes the trade, with next-open fills
With the default next-open fill, if a stop loss, take profit, trailing stop, break-even stop or time exit closes a trade on the same candle your entry crosses, a new trade opens at the next candle's open. With the setting on, the rule was true on the exit candle, so the engine waits for the next cross. With close fills, neither mode can open a trade on the candle a trade closed on, so there is no difference. An exit condition never causes this difference (see Which candle is the exit candle, above).
A cross on the first candle
The first candle counts as an exit, so a cross there is skipped when the setting is on.

Joining conditions with OR changes this. Two crossovers joined by OR can be true on back-to-back candles, and a crossover joined by OR with a condition that stays true, such as "price above the EMA", can keep the combined rule true for many candles. In both cases the setting matters again.

Choosing a Mode

Turn the setting on when each signal should produce at most one trade. This fits mean-reversion entries such as "RSI below 25" or "price below the lower Bollinger Band", where the idea is a single bounce. If the first trade is stopped out, the setting makes the strategy wait for a new setup instead of buying the same dip again.

Leave it off when your entry rule describes a state you want to be in. Trend-following rules such as "long while the close is above the 200-period EMA" should get back in after a take profit or a trailing stop, because the trend the rule describes is still there.

If you are not sure, run both and compare the results. A large gap in trade count between the two tells you how often your strategy was re-entering on the same signal.

Alerts and Paper Trading

When a strategy runs forward on live candles, as alerts and paper trading do, it follows this setting exactly as the backtest does. There is no separate setting for alerts or paper trades.

A run start counts as an exit there too. Every new run waits, with the setting on, for the combined entry rule to turn false and then true again before its first entry. That includes a run you just created, a run restarted after you edit the strategy, and a run restarted after you turn it back on. With the default, a new run can enter on its very first candle if the rule already holds.

Common Mistakes and Misconceptions

Does the setting stop the engine from holding two trades at once?
No, and it does not need to. The engine never holds more than one position at a time in either mode: while a trade is open, further entry signals are ignored. The setting only decides what happens after the trade closes.
Why did a reset during my trade not count?
Only candles from the exit on count. A reset that happened while the trade was open is already in the past when the trade closes, so it says nothing about whether the signal after the exit is new.
Skipped signals are not counted as triggers
A signal the wait skips does not open a trade, and it is not counted as a trigger in the condition statistics on your results.
The setting does not change your exits
Stop losses, take profits and exit conditions work the same in both modes. If a strategy keeps getting stopped out, the setting reduces how often it tries again on the same signal, but the stop itself is unchanged.

Where to Go Next

Entry & Exit Conditions -- how conditions combine into the entry rule this setting watches.

Stop Loss, Take Profit & Trailing Stops -- the exits that most often close a trade while the entry rule still holds.

How the Simulation Works -- the candle-by-candle loop, fill timing and the position lifecycle.