Skip to content
TradingTune
Backtesting Validation

How do you audit same-bar stop and target fills in a backtest?

Audit same-bar stop and target fills by checking order timing, intrabar evidence, and fill assumptions.

On this page

Key takeaways

  • A bar that reaches both exit levels does not show which level came first.
  • Check that each exit order was active before treating the bar as an ambiguous case.
  • Lower-timeframe data can narrow the sequence without proving the actual fill.
  • Keep unresolved cases and changed assumptions visible in the audit record.

What makes a same-bar fill worth auditing?

Audit a same-bar stop and target fill by finding bars that reach both exit levels, checking when the orders became active, and comparing the recorded exit with the available price sequence and fill assumptions for that run. If the sequence cannot be established from the available evidence, mark the case as unresolved rather than treating the reported exit as an observed fact, and preserve a clear record of the assumptions that led the simulation to its recorded outcome.

A stop is an order intended to close a position when a specified price condition is reached, although the trigger level and the eventual fill price need not be identical. A target is an exit level intended to close the position at a specified price or better, typically through a limit order that remains subject to the applicable fill conditions. A fill is the simulated execution of an order in the backtest.

A chart bar summarizes a period with an open, high, low, and close, but those values do not provide a complete record of the price path during that period. If its range contains both exit levels, the bar summary alone does not necessarily reveal which level came first during that period, so the recorded exit may depend on the simulation’s assumptions about the sequence rather than on a directly observed sequence.

The audit asks a specific question: does the recorded exit follow from information available when the orders were active and from the simulation rules, or does it depend on a sequence that the bar cannot establish? It is especially useful when exits sit close together or a bar covers a wide range, since either situation can put both levels inside the same recorded price range.

Which trades belong in the audit?

Start with a saved run and identify closed trades whose exit bars could have reached both the stop and the target, keeping the run unchanged while you collect candidates and trace their individual order histories. TradingView says its strategy report lists simulated trades in chronological order, with direction and entry and exit prices, giving the audit a starting point for locating each recorded trade (Strategies, checked 2026-11-28).

For each candidate, record the symbol, chart interval, bar time, position direction, entry time, exit time, and reported exit price, so another reader can locate the same case without relying on a chart marker alone. Add the stop and target levels that applied during the bar, their order types, and the reason given for the recorded exit, noting any level that changed while the position was open.

A screenshot can help locate the case later, but written levels and settings are needed to repeat the check, particularly when a plotted line has moved or the chart no longer shows the same portion of history. The bar range is a screening tool, not a verdict about execution.

For a long position with a stop below the market and a target above it, a low at or below the stop and a high at or above the target identify a possible conflict, subject to the timing of the orders. For a short position, the stop is usually above the market and the target below it, so check the conditions in the other direction and retain the actual order levels rather than assuming that a chart label identifies them.

Keep cases where the position opened during the exit bar in a separate group. A touch before entry cannot close a position that did not yet exist, and a touch before an exit order became active is not an eligible fill for that later order, even if both events appear inside the same chart bar.

Were the stop and target active at the time?

Trace the order sequence before deciding which exit could have occurred, including the time at which the entry was created and filled, the creation of each exit, and any change to either level during the bar. If the script calculates an exit from the entry price, check when that price became available under the chosen calculation settings and whether the script could create the exit before the relevant price movement.

An order active at the start of a bar presents a different question from an order created after an entry within that bar, because the latter cannot respond to a move that occurred before it became eligible. The chart’s final high and low do not separate those events or show whether the order existed when either extreme occurred.

Also check whether the exit quantities cover the position and whether another order can cancel or reduce an exit, since the amount still open can affect what a later order is eligible to close. A partial close, a revised stop, or a separate closing rule can make a simple stop-versus-target comparison misleading if the audit treats all displayed levels as unchanged orders for the full position.

Record the actual orders and their state instead of assuming that chart labels describe the whole sequence, and note any information the script or report does not make available for the case. TradingView’s property documentation says recalculation after an order fill permits an additional intrabar order calculation, which is relevant when checking when an exit could be created (Strategy properties, checked 2026-11-28).

Note whether that setting was enabled, then inspect what the script does on that calculation rather than assuming that the setting alone creates the intended exits or that every displayed level was active throughout the bar.

What can the bar tell you about the sequence?

Consider a long position already open before the bar, with both exits active and the bar opening between their levels, so the question concerns the order of subsequent touches rather than the timing of entry. If the low reaches the stop and the high reaches the target, the bar places both levels within its range but does not establish which came first or whether a modeled order met all its fill conditions.

Observation Audit reading
Both levels lie inside the bar range Inspect order timing and fill conditions.
An earlier smaller bar reaches only the stop The sequence supports a stop-first reading if the orders were active.
A smaller bar reaches both levels Its internal sequence remains unresolved from its summary alone.
A touch occurs before an order is active That touch is not eligible for the later order.

The same reasoning works for a short position after reversing the price directions, while still checking whether the stop and target orders were active when the relevant touches occurred. Avoid inferring the sequence from the bar’s color or its closing price: neither records the path through the bar, and either can be consistent with different orders of the high and low.

A gap needs its own check. If the market opens beyond a level, distinguish the event that triggers an order from the price at which the model fills it, and record whether the position and exit order were already active before the gap. The related article on overnight gaps and stop fills covers that separate question, including why a stop level and its modeled fill need not match.

Can lower-timeframe data settle the case?

Inspect the same period on a lower timeframe, meaning bars that each cover less time than the chart bar being audited, and match the symbol, session, time zone, and adjustment context before comparing their sequence. A mismatch in those details can make an apparent disagreement a data comparison problem rather than an order problem, so record the context used for both views before interpreting a difference.

Read the smaller bars in time order and mark the entry, the point at which the exits became active, and the first eligible touch of either level, without counting a touch that preceded order activation. If the stop appears in an earlier smaller bar and the target appears only in a later one, the data supports that ordering for active orders, although it does not establish an actual fill price or quantity in a live market.

TradingView says Bar Magnifier gives its emulator access to lower-interval price changes during backtesting, providing a way to compare a run with more detailed historical price information (Bar Magnifier, checked 2026-11-28). Its documentation also warns that early trades might not be affected when lower-timeframe history is insufficient. Check coverage for the particular case instead of treating an enabled setting as proof that every historical bar received the same detail, and retain an uncertainty note if coverage cannot be established.

A smaller bar may still contain both levels, leaving its internal sequence unknown. Missing bars, feed differences, and uncertain order activation can also prevent a conclusion, even when the lower-timeframe chart appears more detailed than the chart used for the original run. Record the finest evidence inspected and leave the result unresolved when it does not distinguish the possible paths or does not show when the relevant orders became active.

Which fill and calculation settings need a separate check?

Save the strategy properties with the case, including historical bar detail, recalculation, order processing, limit verification, slippage, and commission, so a later review can distinguish a change in inputs from a change in the simulation’s fill assumptions. Slippage is the difference between an expected order price and the modeled fill price, while commission is a modeled trading fee that belongs in the run record even though it does not establish the path within a bar.

These settings answer different questions, so do not change them all at once and attribute a changed exit to a single cause; instead, preserve the baseline and describe each separate comparison. TradingView describes its slippage property as a value added to the fill price of market or stop orders, making the order type relevant when reviewing a modeled fill (Strategy properties, checked 2026-11-28).

Record the order type and modeled price separately from the level that triggered the order, especially when a stop fills away from its specified level, and avoid treating that difference alone as evidence that the wrong exit came first. A target limit needs its own inspection, because a chart touching the target is evidence about the displayed range rather than proof that an order for the full position would have filled.

Note the limit verification setting and the limits of the available data: a historical bar does not show the entire order queue or all liquidity available at the target. For a broader discussion of modeled costs, see modeling slippage and commission, which complements the sequence check without resolving an unknown path.

Could calculation timing introduce future information?

TradingView’s strategy documentation warns that calculations after order fills can introduce lookahead bias on historical bars because current-bar price and volume variables can contain final values, even when the calculation represents an earlier point within the bar (Strategies, checked 2026-11-28). This warning matters when an exit level or order decision depends on the current bar’s final range.

Lookahead bias means using information before it would have been available; inspect exit logic that reads the completed bar while acting earlier within it, and ask whether the same value would have been known at that point in the sequence. A level calculated from a final high or low deserves a separate note if the modeled order is presented as active before that extreme occurred.

Compare the script’s calculation settings with the order timeline recorded for the case, rather than assuming that a visible line was available for the entire bar. If the logic cannot be traced from the available script and run settings, record that limitation alongside the fill rather than assigning a confident stop-first or target-first label.

A comparison with a different calculation setting can help identify dependence on that setting, but it changes the test and may also change subsequent orders. Preserve both versions of the record and describe the exact difference before interpreting the affected trade.

How can you compare alternate fill assumptions fairly?

Keep a baseline copy of the run, then change one fill or calculation assumption for a separate comparison, leaving the remaining setup unchanged so the reason for any difference is easier to investigate. Preserve the script version, inputs, symbol, chart interval, date range, session, and other properties, and record the exact change rather than labeling a run simply as realistic or conservative.

Compare candidate trades by their entry and bar time, not just by their position in the report, because a changed exit can alter the later position state and lead to a different sequence of entries. Identify the earliest divergence and inspect it before interpreting later differences, even when the script and its inputs have not otherwise changed.

For a case whose sequence is unresolved, record plausible alternatives as scenarios rather than replacing the reported trade with a guessed outcome, and explain which missing observation prevents the alternatives from being distinguished. If the evidence supports a stop-first sequence, state what establishes that ordering and whether order activation and fill conditions were checked; apply the same standard to a target-first reading.

The comparison is a test of dependence on assumptions, not proof of future execution. Even a stable recorded exit under the available settings leaves market depth, latency, and the actual sequence of transactions outside what a bar summary can establish, so retain those limits when sharing the audit.

How can you check several parameter combinations by hand?

A parameter combination is a set of input values used for a backtest. To see whether the same-bar issue depends on exit distances, a manual sweep repeats the backtest with different combinations while keeping the rest of the setup fixed, then retains the trade record for each run. Record each combination before moving to the next, so the trade list and its candidate bars can be traced to the inputs that produced them.

For each run, flag candidate bars using the stop and target levels active in that run, then inspect cases with the order-timing and lower-timeframe checks described here. A changed input can alter entry timing as well as exit levels, so a case that disappears from the list is not automatically resolved and may no longer be directly comparable with the baseline trade.

Keep separate notes for supported, inconsistent, and unresolved cases in each run. If a fill assumption changes during the sweep, mark it as a separate comparison rather than mixing it with the parameter change, and preserve the baseline so a later review can reconstruct what was tested.

TradingTune is a free Chrome and Brave extension that adds a search panel to TradingView’s strategy dialog. It backtests your input combinations, ranks every run live, and sends the best settings back to your strategy. The audit still requires a review of order timing, evidence, and fill assumptions for the cases selected, rather than treating the repeated runs as proof of an intrabar sequence. The manual parameter sweep workflow explains how to keep repeated runs organized.

TradingTune for Chrome

Stop tuning your strategy's inputs by hand.

Add to Chrome, it's free

Free tier, no API keys. A free account is required to run. Not affiliated with TradingView, Inc.

What belongs in the final audit record?

For every reviewed case, retain the run identity, chart bar, position direction, entry and exit order details, active levels, and reported fill, along with the evidence used to assess order timing. Add the lower timeframe inspected and any gaps or context differences found, so another reader can distinguish an observed bar range from a sequence inferred by the model.

Use a plain status for each case: supported by the available sequence, inconsistent with that sequence, or unresolved. Add a short reason and name any assumption that could change the reading, including whether the exit orders were known to be active before the relevant touches.

An inconsistent case is a prompt to recheck order timing, settings, data alignment, and the script before treating it as a platform error, since a mismatch can arise from comparing different order states or different price contexts. Summarize which fill settings were compared and whether changes caused later trades to diverge, while keeping the earliest identified difference linked to its supporting evidence.

Do not silently discard cases with missing detail or present the more favorable scenario as the observed path; if the data cannot distinguish the exits, that limitation is part of the finding. Keep the audit with the saved strategy version and run notes, so the case remains interpretable after the chart or inputs change.

The common backtesting mistakes guide provides wider context for reviewing a backtest, while this record preserves the specific evidence, assumptions, and unresolved questions behind the same-bar fill review.

Sources

TradingTune for Chrome

Stop tuning your strategy's inputs by hand.

TradingTune runs systematic parameter searches on your own TradingView strategy, right inside the chart page. You keep the strategy, you read the results.

Free tier, no API keys. A free account is required to run. Not affiliated with TradingView, Inc.

Share this post