Trading

Stop and Target in the Same Candle: The Backtest Trap

6 min read

Last saved:

এই লেখাটি বাংলায় পড়ুন

Stop and Target in the Same Candle: The Backtest Trap

Executive Summary

  • ✦OHLC shows a range, not necessarily the order of price movements.
  • ✦The same hypothetical candle can produce +£48 or −£52 after costs.
  • ✦Inspect order activation, intrabar data and simulator fill assumptions.
  • ✦Test alternative sequences; finer data still cannot guarantee real execution.

বাংলায় পড়ুন

A daily candle can reach both your stop and your profit target. If your backtest records a winner, does that prove the target came first? No. The candle’s open, high, low and close summarise the session; they do not necessarily reveal the order in which prices traded.

This matters especially when a strategy uses daily signals but protective orders can execute during the day. A profitable simulation may depend on a hidden assumption about the path inside each candle.

Learning objective

Learn to identify ambiguous stop-and-target outcomes, calculate how much they affect a backtest, and choose a repeatable review process before changing a trading strategy. This extends our general backtesting guide with a specific execution problem.

Step 1: distinguish a price range from a sequence

OHLC means opening, highest, lowest and closing price. Knowing a day opened at £100, reached £106 and £94, then closed at £102 does not tell you whether £106 or £94 occurred first. There could also have been many crossings between those prices.

For an open long position with a stop below entry and a target above it, first contact matters. Once one exit closes the whole position and cancels the other, later prices cannot change that trade’s realised result.

That assumes the exit linkage behaves as intended. Our bracket-order and OCO guide covers the separate operational risks of linked orders.

Step 2: work through one hypothetical candle

Assume a fictional share trade with these deliberately simplified rules:

  • Buy 10 shares at the day’s £100 opening price using a decision made before that open.
  • A protective stop at £95 and target at £105 become active immediately after the entry.
  • Either exit closes all 10 shares and cancels the other; there is no second entry that day.
  • Assume continuous movement, full fills at the specified prices and no slippage. Deduct £2 in total round-trip costs in either case. These are teaching assumptions, not realistic guarantees.

The day’s OHLC is £100 / £106 / £94 / £102. Two possible sequences fit those same four figures:

Possible price sequenceFirst exitGross resultAfter £2 costs
£100 → £106 → £94 → £102Target at £105(£105 − £100) × 10 = +£50+£48
£100 → £94 → £106 → £102Stop at £95(£95 − £100) × 10 = −£50−£52

The difference is £100 for the same apparent daily candle. The closing price of £102 cannot resolve it, because both hypothetical trades have already exited before the close. Nor should a backtest record both exits as separate profits or losses for the same fully closed position.

Step 3: inspect your simulator’s fill assumptions

TradingView’s strategy documentation explains that its emulator infers an intrabar path when using chart data, and can use lower-timeframe history for more detail. An inferred path is a simulation assumption, not an observed sequence.

NinjaTrader’s historical-fill documentation similarly distinguishes standard processing from a higher-resolution series used for fills. Record the actual platform version, data coverage and settings used in your test rather than assuming all engines produce identical results.

Keep three questions separate: when the signal became knowable, when the entry could fill, and when its exits became active. A signal requiring the completed daily close cannot justify an entry at that same morning’s open. More detailed fill data does not repair that look-ahead error.

Step 4: measure sensitivity instead of choosing the nicer result

Flag trades where both exits lie inside a bar while the position and both orders could have been active. Then inspect smaller bars or timestamped trades where available. A one-minute bar can still contain both levels, so smaller bars reduce ambiguity without necessarily removing it. Last-trade data alone also does not prove your limit order had queue priority or sufficient liquidity to fill.

If sequencing remains unknown, report alternative assumptions. For example, suppose 20 ambiguous trades each have the same quantities, prices and costs as our example. All target-first outcomes total +£960; all stop-first outcomes total −£1,040. The £2,000 spread is a sensitivity test under those simplified rules, not an estimate of actual profits or a probability interval.

In a real strategy, different exits may change later entries, available cash and position size. Rerun the entire simulation under each assumption rather than simply changing a final total. A stop-first run is a cautious comparison, but it is not the worst possible real-world outcome: gaps, slippage or failed exits can cause larger losses.

Common mistakes

  • Always awarding the target when a candle touches both levels.
  • Assuming a green candle means its low occurred before its high.
  • Counting high or low prices reached before the entry as available exits.
  • Ignoring missing lower-timeframe history or session mismatches.
  • Dropping ambiguous trades without showing how many were removed and why.
  • Optimising the stop until the simulator produces attractive fills, then calling that evidence of an edge.

Practical checklist

  1. Were the entry signal and order instructions available before the simulated fill?
  2. When did both exits become active, and what cancels the unused one?
  3. How many trades depend on an unknown intrabar sequence?
  4. Which timestamps, sessions and price type does the fill dataset use?
  5. Do results survive alternative sequencing, realistic costs and gap scenarios?
  6. Are the rules frozen before testing untouched data and observing forward execution?

The Money Man View

For a daily strategy, daily signals and intraday execution are different layers of the same test. Keep the signal timeframe unchanged when investigating fills, so you can isolate the effect. If modest changes in sequencing reverse the conclusion, the evidence is too fragile to support confidence in the strategy. Better data may narrow the uncertainty; it cannot guarantee future results.

The Money Man uses AI-assisted research and writing. Educational information only, not personalised investment advice. Every price, quantity and result in the worked examples is hypothetical. Simulated fills do not guarantee real execution, and trading can lose capital. The AI-generated cover is a conceptual illustration, not market data or a recommended trade.

Share this post