NOONOO TRADINGStart in the bot

When a Take-Profit and Stop-Loss Both Touch in One Candle: Hidden Backtest Inflation

Most historical strategy tests use OHLC candle data. A candle contains only four prices, and the sequence between them is not recorded. If a target and stop both touch within one candle, the backtest must choose a result without knowing the answer. That choice changes the report.

A candle contains only four prices

An hourly candle records open, high, low and close. Whether the price rose first or fell first is absent. This becomes a problem when both the target and stop lie within the candle's high-low range.

A candle with unknown ordering

Open $100; high $104; low $97; close $101.

Long entry $100.
Target $103, +3%.
Stop $98, −2%.

High $104 ≥ target $103 → touched.
Low $97 ≤ stop $98 → touched.

─────────────
Both touched,
but the first is unknown.

Under simplified level-fill assumptions, the trade either hit $103 first and earned +3%, or hit $98 first and lost −2%. That is a five-percentage-point difference that OHLC alone cannot resolve.

One assumption changes the report

A backtest applies a rule to resolve such cases. Target first is optimistic; stop first is pessimistic. Consider 100 trades.

100 trades; 12 ambiguous candles

88 unambiguous trades:
40 targets × +3% = +120%.
48 stops × −2% = −96%.
Arithmetic subtotal: +24%.

Optimistic: Target first.
12 × +3% = +36%.
Total +60%; win rate 52%.
Total profit 156 ÷ total loss 96 = PF 1.63.

Pessimistic: Stop first.
12 × −2% = −24%.
Total 0%; win rate 40%.
120 ÷ 120 = PF 1.00.

─────────────
Same strategy, data and period.
One ordering assumption separates +60% and 0%.
These totals sum trade percentages; they are not compounded account returns.

Only 12% of trades were ambiguous, yet the conclusion changes from apparently useful to breakeven. A report may not disclose this internal processing choice, so its numbers alone do not reveal the assumption. See the backtesting guide for broader validation traps.

Narrow targets and stops increase ambiguity

The affected proportion varies by strategy. If target distance plus stop distance is smaller than the candle's high-low range, both levels can be reached within it.

An hourly candle with a 3.0% range

Swing example: Target +3%; stop −2%.
Total distance 5.0% > 3.0% range.
→ Such a candle generally reaches only one side.

Short-term example: Target +0.8%; stop −0.5%.
Total distance 1.3% < 3.0% range.
→ Back-and-forth movement can repeatedly touch both.

─────────────
Tighter stops can make the backtest
more dependent on assumptions.

Narrowing a stop can improve reported results because losses look smaller, while part of that improvement may actually come from optimistic processing. This makes searching for an optimal narrow stop especially risky. See multiple-testing traps, and ATR and stops for volatility-related distances.

Lower timeframes reduce but do not eliminate the problem

A common response is to inspect smaller candles. Splitting an hour into 60 one-minute bars usually clarifies which level came first, but moves the unresolved question to a smaller unit.

Moving to one-minute bars

One hourly candle → 60 one-minute candles.
Check highs and lows chronologically.
→ Most ambiguity can be resolved.

Yet one-minute ranges may be:
average 0.15%;
sharp-move periods 1.2% or more.

Scalping target +0.3%; stop −0.2%.
Total 0.5% < a volatile 1.2% minute.
The same ambiguity returns.

─────────────
Resolving the price sequence fully requires tick records.
Candles alone can only reduce ambiguity.

A practical comparison asks whether the combined distances are comfortably larger than typical candle ranges. Similar or smaller distances require lower-timeframe examination. In either case, report the remaining ambiguous percentage alongside results.

Ambiguous candles can also have greater slippage

The two problems often overlap. A candle spanning both exits indicates substantial movement, which can also make execution deteriorate.

The guide's hypothetical +3% backtest versus −3.2% live outcome

Target limit: $103.
The example assumes it remains unfilled despite a chart high of $104.

Price reverses toward $97.
Market stop executes at $96.8,
$1.2 below its intended $98.

Recorded backtest: +3.0%.
Assumed actual result: −3.2%.
Difference: 6.2 percentage points.

At 10x leverage:
−32% relative to margin.

A touch alone does not guarantee a limit fill, since earlier orders can consume the available flow. A market stop instead seeks execution but can suffer adverse prices. That asymmetry can compound optimistic sequencing assumptions. See execution queue priority, slippage and liquidation cascades.

What to check in a report

Whether reading your own backtest or someone else's, check the following. Without an answer, do not assume ambiguity was handled conservatively.

Checklist

□ How many trades touched both exits in one candle?
□ What percentage of all trades was that?
□ Which exit was processed first?
□ How much do pessimistic assumptions change the result?
□ Were smaller candles checked?
□ How much ambiguity remains?
□ What slippage was assumed?
□ Were target limits incorrectly treated as guaranteed fills?

─────────────
A transparent report shows optimistic and pessimistic results together,
bracketing the sequencing assumption while other execution risks remain.

An optimistic-only report gives an upper-bound scenario under its assumptions. Showing both reveals uncertainty; a very wide gap suggests the test is not ready to support a conclusion. See sample size, walk-forward analysis, candle-close confirmation and risk/reward.

Recap

OHLC contains four prices but no internal sequence.
When both exits touch, the true order is unknown.
A rule selects one outcome.
Target first is optimistic; stop first is pessimistic.
Just 12% ambiguity separates +60% and 0% in the example.
PF differs: 1.63 versus 1.00.
Combined exit distance below candle range permits both touches.
Tightening stops increases dependence on assumptions.
Minute candles reduce, not eliminate, ambiguity.
Tick records are needed to resolve the price sequence fully.
Ambiguous candles can also produce more slippage.
A target touch is not a fill guarantee.
Report both optimistic and pessimistic scenarios.

A candle-based backtest contains decisions made by the program where data cannot answer. Before reading its results as strategy quality, identify how many trades required those decisions and which assumption was applied.

Caution

All numbers are hypothetical illustrations, not measured strategy or account performance: OHLC $100/$104/$97/$101, target $103 and stop $98, 12 ambiguous trades out of 100, 40 wins and 48 losses among the other 88, totals +60%/0%, PF 1.63/1.00, a 3.0% candle range, minute ranges of 0.15% and 1.2%, the assumed $96.8 fill and −3.2% result, and −32% margin return at 10x. Measure ambiguity in your own data because it varies by asset, timeframe and exit distances. Ranges and slippage also vary by venue, liquidity and session. Historical results do not guarantee future outcomes. Leverage can lose all principal, and decisions remain your responsibility.

NOONOO TRADING invites you to follow live trading in our free chat.

Start in the bot

📈 OKX trading fee discount for new registrations

Register for the OKX Fee Discount →