Skip to content

Intrabar path ambiguity

The same OHLC bar can produce a target exit, a stop exit or different conditional fills. Reproduce two paths and expose the ordering assumptions in a backtest.

Intrabar path ambiguity is the inability to determine the sequence of price events inside a bar from its open, high, low and close alone. When a trading rule depends on which level is reached first, the same recorded bar can support different simulated trades and different P&L. This is a specific information loss in backtesting, rather than a rounding error in performance calculations.
An OHLC bar records the opening price, the two extremes and the closing price. It does not timestamp the extremes or preserve every intervening visit. Knowing that a stop and a target were both inside the range does not establish which order could have closed a position first.

One bar, two incompatible trade histories

Consider a fictional bar with open 100, high 110, low 90 and close 105, all in USD per share. A long position enters at the opening price of 100. Immediately after entry, a sell stop order at 95 and a take-profit sell limit order at 108 are active.

For this example only, stipulate continuous price paths, full execution exactly at the first touched exit price, no spread, fees, slippage or latency, and instantaneous cancellation of the other exit after the first fills. There are no additional entries. These conventions isolate ordering; they are not an execution guarantee.

Admissible schematic pathFirst exitGross realised P&L per share
Open 100 → high 110 → low 90 → close 105Target at 108+8 USD
Open 100 → low 90 → high 110 → close 105Stop at 95−5 USD
The first path crosses 108 on its initial rise, so the subsequent fall cannot stop out a position already closed. The second crosses 95 on its initial decline, so the later rally cannot rescue that closed trade. Both paths reproduce every reported OHLC value. Their realised outcomes differ by 13 USD per share, solely because the first-exit rule sees a sequence the bar does not reveal.
Two fictional paths share open 100, high 110, low 90 and close 105 USD per share. The high-first path exits at target 108 for plus 8 per share; the low-first path exits at stop 95 for minus 5. Both assume exact fills and immediate cancellation of the other exit.
Two fictional paths share open 100, high 110, low 90 and close 105 USD per share. The high-first path exits at target 108 for plus 8 per share; the low-first path exits at stop 95 for minus 5. Both assume exact fills and immediate cancellation of the other exit.
Original continuous-path scenarios, not observed ticks. Horizontal positions show event order rather than elapsed time. Both exits are active immediately after the opening entry; full fills occur at the first touched exit and cancel the other instruction.

The positive close-to-open move of 5 is irrelevant to this bracket trade's realised P&L. Neither path keeps the position until the close. Likewise, two examples do not imply equal probabilities: the bar supplies no 50–50 distribution over paths.

An order must exist before its fill

The problem extends beyond choosing between two exits. A stop-limit order first activates a limit instruction, which can only execute afterward. TradingView's official stop-limit example explicitly demonstrates a limit price reached before activation producing no entry. Its order documentation makes activation and later filling separate events.

For a deliberately stark illustration, replace the long position and its exits with one buy stop-limit instruction accepted before the same bar opens: activation at a qualifying path price of 108 or above, then a buy limit of 95. Keep continuous paths, instantaneous activation and full touch fills after activation.

On the high-first path, reaching 108 activates the buy limit; the subsequent fall through 95 fills it. On the low-first path, the early visit to 95 occurs while the limit is inactive. The later rise activates it at 108, but the remaining path ends at 105 without returning to 95: no fill occurs within this bar. Testing only “high at least 108 and low at most 95” would falsely fill the second scenario.

Entry timing matters for exit orders too. If entry occurs partway through a bar, an earlier low cannot retrospectively stop out the new position. A simulation needs an order-state timeline as well as a price path.

INTERACTIVE EXPLORER

Intrabar stop and target ambiguity

Compare two paths consistent with the same OHLC bar.

Make the missing sequence visible in the result

A bar-based engine must impose a convention or obtain more information. TradingView, for example, documents historical path assumptions based on the open's proximity to the high or low, and a higher-detail setting that uses lower-timeframe bars. These are documented simulation choices, not reconstructed observations of every trade. Read its broker-emulator assumptions.

A defensible research report can:

  • Use finer observations where available, retaining any unresolved ties inside the smaller bars. Recorded trades still do not establish your queue priority or available executable size.
  • Freeze a deterministic ordering convention before comparing strategies, record which trades depend on it, and show sensitivity to the alternative. Choosing the profitable ordering after seeing the bar embeds optimism.
  • Keep ambiguous cases explicit or calculate alternative feasible histories. In the simple single-trade fixture, the two exit outcomes are −5 and +8 per share. These are conditional scenario outcomes under exact fills, not bounds on real execution losses. Removing ambiguous trades also changes the evaluated sample and should be reported.

For a multi-trade strategy, alternative exits may change cash, later entries and subsequent holdings. Carry each scenario through the full state evolution; adding isolated best and worst trade outcomes need not describe a feasible portfolio path.

Ordering and execution are separate uncertainties. A real stop becomes a market order on activation, so its execution price can differ from its trigger; a limit constrains price without promising completion. Investor.gov explains these order distinctions. Filling every touched price exactly, even with the correct path, can still overstate feasibility.
Positions, Trades, Fills and P&L develops the cash-and-holdings ledger needed to carry these different fill histories into portfolio wealth. The preview is public; the full lesson requires membership.

Sources

Last updated
  • backtesting
  • ohlc
  • event ordering
  • conditional orders
  • fill simulation
← Back to the glossaryBack to top ↑