Stop and target hit in the same candle: which one counts in a backtest?
Why a candle cannot tell the order, what the usual rules do to your numbers, and the exact rule Edgetrail’s replay uses.
Short answer
When one candle touches both your stop and your target, its open, high, low and close cannot tell you which came first, so every backtest needs a fixed rule for it. Edgetrail’s bar replay fetches the 1-minute candles of that period and lets them decide; if even the 1-minute candles cannot tell, or you already replay on 1 minute, the stop counts. In the example below the choice is worth 3 R on a single trade, and if 10 of 100 trades are like it, “target first” makes the expectancy look 0.30 R per trade better than it was.
Why a candle cannot tell the order
A candle stores four prices: open, high, low and close. It does not store the path between them. A 15-minute candle with a high above your target and a low below your stop could have gone up first and then down, or down first and then up – both paths draw exactly the same candle. Larger timeframes make it worse: a 4-hour or daily candle covers so much range that both levels sit inside it far more often. The tighter your stop and target relative to the candle, the more trades land in this grey zone.
What backtesting tools usually do
There are four common answers, and each one changes the result:
- Target first. The optimistic choice. It quietly turns ambiguous losers into winners and is the reason many backtests look better than live trading.
- Stop first. The conservative choice. It can understate a strategy, but it never invents profit.
- Guess the path from the open. TradingView’s Pine Script strategy tester assumes that when a bar opens closer to its high, price went open → high → low → close, and the reverse when it opens closer to the low; its “Bar Magnifier” option instead reads lower-timeframe bars, available on its Premium and Ultimate plans (TradingView Pine Script docs: Strategies, broker emulator, checked on 4 November 2026).
- Look at finer data. Split the candle into smaller candles or ticks and see which level was touched first. This is the most accurate, but it needs the finer history.
Whatever tool you use, find out which of these it applies before you trust a win rate – the checklist for crypto backtesting software lists it as one of the points to check.
Edgetrail’s exact rule
- Entry candle: if the candle in which your entry fills also touches the stop, the stop counts – nobody knows what came first. When it touches the target as well, or when a limit or stop entry filled somewhere inside that candle and the stop was touched, the 1-minute candles of that candle decide.
- Later candles: if a candle opens beyond your stop, the trade exits at that open, not at the stop price; a candle that opens beyond the target exits at the better open. If a candle touches only one level, that level counts.
- Stop and target in one candle: Edgetrail fetches the 1-minute candles of exactly that period and replays the trade through them.
- Still unclear: if a single 1-minute candle touches both levels too, if no 1-minute data comes back, or if you replay on the 1-minute chart already, the stop counts.
The trade is always evaluated on the timeframe it was drawn on, so switching the visible chart later does not change its result. The finished trade lands with its R in the backtest journal of your system. The same rule is summarised on the methodology page.
A worked example
| How the candle is resolved | This trade | If 10 of 100 trades look like this |
|---|---|---|
| Target first (optimistic) | +2.00 R | expectancy +0.30 R higher than “stop first” |
| Stop first (conservative) | −1.00 R | the baseline |
| Path guessed from the open (closer to the low → low first) | −1.00 R | depends on each candle’s shape |
| Edgetrail: 1-minute candles decide (here the stop at minute 4) | −1.00 R | follows the finer data; stop when still unclear |
Long at 60,000, stop 59,700 (risk 300), target 60,600. One 15-minute candle later in the trade: open 60,050, high 60,650, low 59,650, close 60,200. Illustration, computed; R without fees as in the replay journal.
What happened in the example
The long risks 300 per unit, so the target at 60,600 is +2 R and the stop at 59,700 is −1 R. The 15-minute candle reaches both. Its open is 400 above the low and 600 below the high, so an open-based guess would assume the low came first. Edgetrail does not guess: it loads the fifteen 1-minute candles of that quarter hour. In this illustration the fourth minute trades down to 59,650 while the high of 60,650 only comes in the eleventh minute, so the stop was hit first and the trade is booked at −1.00 R. Had the candle opened at 59,500 – a gap below the stop – the trade would have exited at that open: (59,500 − 60,000) ÷ 300 = −1.67 R.
The size of the effect is easy to underestimate. Each ambiguous trade swings by 3 R between the two simple rules. If 10 of 100 trades are ambiguous, that is 30 R in total, or 0.30 R per trade – more than the whole edge of many strategies. The glossary defines expectancy and the other numbers this changes.
How to keep your results honest
- Count the ambiguous trades. If more than a few percent of your trades are decided inside one candle, your stop is small relative to the timeframe. Replay on a lower timeframe or widen the plan.
- Never resolve in your favour by hand. Moving a trade from loser to winner because “it probably hit the target first” is look-ahead with extra steps.
- Subtract costs yourself. Replay trades are booked in R without fees, slippage or funding. Take something like 0.05 R to 0.1 R off each trade before you compare it with your live journal; what a good profit factor is shows how fast costs shrink an edge.
- Collect enough trades. One rule choice can move a 30-trade sample from profit to loss; how many trades a backtest needs shows how wide the range still is at 100.
- Check the planned R:R. Very close targets put both levels in one candle more often; the risk/reward calculator shows what win rate each R:R needs.
Replay runs on real candles from Bybit, Binance, OKX and Coinbase – 4,952 crypto markets as of 4 November 2026, from 1-minute to weekly candles. For Bitcoin, 1-minute history goes back to 20 July 2015 (BTC-USD on Coinbase). Edgetrail costs $24 a month or $199 a year; the first 50 Founders pay $99 once, after that a Lifetime plan costs $249 once. The first 14 days are free without a credit card, and every payment comes with a 14-day money-back guarantee.
Updated:

Frequently asked questions
What happens in a backtest if stop and target are hit in the same candle?
It depends on the tool’s rule: target first, stop first, a path guessed from the open, or a look at finer data. Edgetrail checks the 1-minute candles of that period and counts the stop if they cannot tell either.
Why does Edgetrail count the stop when it is unclear?
Because the conservative choice never invents profit. Counting the target when the order is unknown would turn ambiguous losers into winners and make the backtest look better than live trading.
What if the candle gaps past my stop?
If a later candle opens beyond your stop, Edgetrail exits at that open price, so the loss can be larger than 1 R. A candle that opens beyond the target exits at the better open.
Does this rule include fees?
No. Replay trades are booked in R against the initial stop without fees, slippage or funding, so subtract your costs before comparing replay results with live trades.
Keep reading
$24 a month · $199 a year · $99 once as a Founder (50 spots) · later $249 Lifetime. The first 14 days are free, no credit card.
All pricesReady to face your numbers?
Log your first trade in minutes. 14 days free, no credit card.
Try free for 14 days