One candle, two stories: did you hit the target or the stop?
A candle shows four prices but not their order. One assumption about that order turned 0 profitable settings into 486. Same data, same rules.
TradeXAI research · 5 min read
Your target is just above the price. Your stop is just below it. The next candle is a big one: its high is above your target, and its low is below your stop.
So, did you win or lose?
The honest answer: the candle does not know. It gives you four prices: open, high, low, close. It does not tell you the order they happened in.
Your backtest has to assume something. That assumption can decide the whole result.
One assumption, opposite answers
We tested a small-target scalp on 1-minute candles, 1,296 settings, twice. The only difference was what the backtest assumed inside a candle that contained both the stop and the target.
| Assumption inside the candle | Profitable settings | Best result per trade |
|---|---|---|
| Pessimistic: the stop is hit first | 0 | -6.3 basis points |
| Optimistic: the target is hit first | 486 | +5.6 basis points |
Same data, same rules. (A basis point is 0.01%.)
To settle it we replayed real trade-by-trade data for 96 coin-days, where the true order is known. Every setting lost. The pessimistic version had been right, and the 486 "winners" were an artefact of the assumption.
If your result depends on what you assume inside a candle, you do not have a result yet.
When does it matter?
Not always. It matters when the target or the stop is small compared with one candle.
With targets of 0.1% to 1% and holds of 15 minutes to 4 hours, our two assumptions agreed within 1 to 2 basis points.
A quick check for your own test: how often do the stop and the target fall inside the same candle?
- If it is rare, relax.
- If it is common, use smaller candles or trade data, or do not trust the result.
The rules we settled on
- Stop first. When both are inside one candle, count the loss.
- Fewer fills. For grid strategies, assume the path inside the candle that triggers fewer fills.
- A delay. In our tick tests, orders went live 250 milliseconds after the signal.
- Or avoid the problem. Some of our tests used time exits only, so there was no stop-versus-target question to answer.
And one more rule, which deserves its own picture.
Touched is not filled
You place a buy limit at $100. The candle's low is exactly $100. Did you buy?
Probably not. A limit order waits in a queue behind everyone who placed theirs earlier. The price touching your level only means someone at that price was filled.
In our tick tests a limit order only counted as filled when a trade happened beyond its price.
This matters most for the strategies that need it most. A scalp that earns one basis point per win lives or dies on whether those fills are real.
Gaps and fast moves
A stop is not a price guarantee. It becomes a market order when the stop price trades, and it fills at whatever comes next.
Crypto trades around the clock, so weekend gaps like in stocks are rare. Fast moves are not.
One crash-fading idea of ours got worse with any extra slippage added. That told us the result depended on fills we could not count on.
Also remember where a trade starts. If a signal comes at a candle's close, the realistic entry is the next candle's open. If that open is already past your stop or target, the trade is different from the one you planned, and the backtest must show that.
Bugs that looked like results
Simulators break in quiet ways. Three from our own log:
- A missing last data point produced a fake -94% candle in an equity curve.
- A paper-trading loop skipped the stop and target checks of the rounds it had missed.
- A failed candle update closed a position and bought it again.
None of these raised an error. We found them by looking at single trades, one at a time.
Your checklist
- State your rule for a candle that contains both the stop and the target.
- Run the optimistic and the pessimistic version. If they disagree, the candles are too coarse.
- Count a limit fill only when the price trades through the level.
- Add slippage to stops.
- Read 20 individual trades from start to finish.
This article is for education. It is not financial advice.
- fills
- stops
- intrabar
- slippage
For education only. Backtests and paper results do not predict future results. Not financial advice.