Order Block Continuation: A Mechanical Return-to-Zone Strategy
An order block is a consolidation zone (a range where price paused) that preceded a directional move. This strategy enters long when price returns to and closes within that zone after moving away, on the assumption that institutional orders resting at those levels will be filled on the retest. The order block is defined mechanically as the highest and lowest points over a trailing lookback period; entry occurs when price has been outside the zone and closes back inside; stop-loss is placed one ATR below the zone low; and target is set at a fixed risk-to-reward multiple.
Why this might work
Support and resistance levels are real market structures. Price does cluster near prior consolidation zones, and significant market participants do place orders at swing highs and lows [1]. The mechanics are straightforward: if a zone represents where buy orders rested after a breakout move in the other direction, a return to that zone should encounter demand and resume the original trend.
However, the evidence for order blocks specifically as a category superior to other zone identification methods is absent. No peer-reviewed research distinguishes order blocks from simple support/resistance, swing highs/lows, or breakout/retest patterns [2]. The appeal of order blocks is practitioner convention: the Smart Money Concepts (SMC) and Inner Circle Trading (ICT) communities have popularised the framework, and online traders report consistent wins, but these reports are selected from a universe of attempts, with no control for the trades that failed or the cherry-picked examples that fit retrospectively.
A critical weakness is definitional slippage. After price has moved, it is always possible to find a prior consolidation zone and call it an order block. This is not falsifiable; the evidence is not forward-looking. In a rigorous test, the zone must be identified in advance, or the identification rule must be mechanical (not dependent on hindsight). [3]
The mechanical version of the strategy presented here avoids that trap by defining the block objectively: the highest and lowest prices over a fixed trailing lookback period, regardless of whether they form a "nice" consolidation visually. This trades interpretive nuance for reproducibility and removes the bias of retrospective block selection. The tradeoff is that many blocks so defined will be arbitrary, price reaching a trailing 20-bar high or low is common and not necessarily meaningful, and this may account for much of the strategy's performance or lack thereof.
The return-to-zone entry is not unique to order blocks. Breakout-retest strategies (enter on the retest, not the breakout) are well-known and often profitable in trending markets [2]. The order block strategy is a variant of that pattern, with no proven advantage.
The rules
Instrument and timeframe: Any liquid instrument. Equity daily or FX 4H recommended for a balance between signal clarity and trade frequency.
Order block definition: The highest high and lowest low of the most recent N bars (default N = 20). The zone is the range between these two prices. The block is valid as long as there are no new 20-bar highs or lows; it resets when the lookback window encompasses a new extreme.
Entry trigger: A close that has moved outside the block (either above the high or below the low on the prior bar) and closes back inside the block (close ≥ block_low AND close ≤ block_high). Only one entry per block retest; once a trade is entered on a return, the block is retired and a new one will form once price makes a new 20-bar extreme.
Initial stop-loss: One ATR(14) below the block low. ATR is the 14-period Average True Range; this stop is approximately 1.0 times the 14-bar volatility below the lower boundary.
Target/exit: Set at entry price plus [(block_high, block_low) × 2.0]. This is a fixed 2:1 risk-to-reward ratio, where risk is entry minus stop.
Position size: 2% of account equity per trade, assuming one trade at a time. Adjust downward if frequent overlapping signals occur.
Session and time filters: None mandatory. For FX, consider excluding the lowest-volume sessions (Tokyo close to London open) if backtests show poor statistics there.
Expected trade frequency: On a 4H timeframe, this setup should generate roughly 150-250 trades per year, depending on instrument volatility and the ratio of time price spends inside vs. outside the 20-bar range. This is frequent enough to gather meaningful statistics, but not so frequent that execution slippage dominates the P&L.
Code
//@version=6
strategy("Order Block Continuation", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=2, commission_type=strategy.commission.percent, commission_value=0.001)
// ============ INPUTS ============
ob_lookback = input.int(20, "Order Block lookback bars", minval=5, maxval=100)
atr_period = input.int(14, "ATR period for stop loss")
atr_mult_sl = input.float(1.0, "Stop loss: ATR multiple below OB low", minval=0.5, maxval=3.0)
rr_ratio = input.float(2.0, "Risk/Reward ratio for target", minval=0.5, maxval=5.0)
// ============ ORDER BLOCK DEFINITION ============
ob_high = ta.highest(high, ob_lookback)
ob_low = ta.lowest(low, ob_lookback)
// ============ ENTRY CONDITIONS ============
// Price was outside the block on the prior bar
was_above_block = close[1] > ob_high[1]
was_below_block = close[1] < ob_low[1]
was_outside = was_above_block or was_below_block
// Price closes back inside the block
now_inside = close >= ob_low and close <= ob_high
// Entry signal: return to zone after being outside
entry_signal = was_outside and now_inside and barstate.isconfirmed
// ============ STOP AND TARGET LEVELS ============
atr_val = ta.atr(atr_period)
stop_loss_level = ob_low - atr_mult_sl * atr_val
risk_amount = close - stop_loss_level
target_level = close + risk_amount * rr_ratio
// ============ ENTRY AND EXIT LOGIC ============
if entry_signal
strategy.entry("OB_Long", strategy.long)
strategy.exit("OB_Exit", "OB_Long", stop=stop_loss_level, limit=target_level)
// ============ VISUALIZATION ============
plot(ob_high, "OB High", color=color.new(color.blue, 0), linewidth=2)
plot(ob_low, "OB Low", color=color.new(color.red, 0), linewidth=2)
fill(plot(ob_high), plot(ob_low), color=color.new(color.gray, 85), title="Order Block Zone")
// Entry and exit level plots (only during active trades)
var float entry_price = na
if entry_signal
entry_price := close
plot(entry_price, "Entry", color=color.green, linewidth=1, style=plot.style_linebr)
plot(stop_loss_level, "Stop Loss", color=color.red, linewidth=1, style=plot.style_linebr)
plot(target_level, "Target", color=color.blue, linewidth=1, style=plot.style_linebr)
How the code works
Lines 10-11: Order block definition. ta.highest(high, ob_lookback) finds the highest high over the last N bars; ta.lowest(low, ob_lookback) finds the lowest low. These form the upper and lower boundaries of the order block zone.
Lines 14-19: Entry conditions. The code checks whether price was outside the block on the previous bar (was_outside) and whether it has closed back inside on the current bar (now_inside). Both must be true, and the bar must be confirmed (not mid-candle).
Lines 22-25: Stop and target calculation. The stop-loss is placed one ATR below the block low. Risk is the difference between entry price and stop. Target is entry plus (risk × RR ratio), implementing a 2:1 risk-to-reward ratio by default.
Lines 28-30: Trade execution. On an entry signal, the strategy enters long at the close. It simultaneously sets a stop-loss at the calculated level and a take-profit target at the calculated level, exiting either when one is hit.
Lines 33-42: Visualization. The block high and low are plotted as lines, with a fill between them to highlight the zone. Entry, stop, and target prices are plotted when active, helping the trader see the setup visually.
Testing it honestly
To evaluate this strategy, use TradingView's Strategy Tester on a 4H timeframe (or daily, depending on your instrument) over at least 3-5 years of historical data.
In-sample and out-of-sample: Test the first 70% of the data with the default parameters (N=20, RR=2.0, ATR mult=1.0). Note all statistics: win rate, profit factor, maximum drawdown, Sharpe ratio. Then lock those parameters and test them on the final 30% of data you did not optimize against. The out-of-sample result is the one that matters; in-sample overfitting is severe with mechanical trading rules.
Costs matter. Set commission to your actual broker's rate (typically 0.1% round-trip for FX, 0.01% for futures). Include realistic slippage: 2 ticks/pips on entry and exit is conservative for liquid pairs. A strategy that looks profitable with zero costs and zero slippage will often fail in live trading.
Sample size: A handful of winning trades proves nothing. Ensure your test period includes multiple market regimes (trending, ranging, high volatility, low volatility). Aim for at least 100-150 trades in your out-of-sample period; fewer than that, and variance dominates the result. A 60% win rate over 50 trades could easily reverse to 40% on fresh data.
Parameter sensitivity: Test what happens if you change N from 15 to 25, or the RR ratio from 1.5 to 2.5. If the strategy falls apart with small tweaks, it is brittle and likely overfit.
Limitations
No empirical evidence of superiority. Order blocks, as a category, have not been shown in peer-reviewed research to outperform simple support/resistance, swing levels, or standard breakout/retest patterns. The fact that price returns to a recent high or low is not remarkable; the question is whether returning to that specific high or low (defined as a 20-bar trailing extreme) has any edge over returning to any other level. The answer is unknown.
Regime dependence. Retest strategies (entering on a retest of a support/resistance level) work best in trending markets where the retested level acts as a bounce point. In choppy, range-bound markets, price may enter and exit the block multiple times without significant directional moves, generating many small losses. The strategy has not been validated across different regimes.
Retrospective bias in zone definition. Although the code defines blocks mechanically (20-bar extreme), this is still arbitrary. Why 20 bars and not 10 or 30? After the fact, an analyst can choose lookback periods that perform well on historical data and claim they are optimal. This is optimization bias. A true test would require the parameter to be chosen before testing, or tested on separate data before claiming a result.
Win rate vs. profit factor. Many order block setups will fail because price enters the zone but does not continue in the intended direction. The strategy depends on a favorable risk-to-reward ratio (2:1 here) to compensate. If win rate is below 33%, then the strategy loses money even if exits are perfect. Ensure the backtest reports actual win rate and profit factor, not just total return.
Survivor bias. Backtests on a single liquid instrument (e.g., EUR/USD or SPY) will be biased toward regimes where that instrument has trended. Test on multiple pairs or equities to gauge robustness. A strategy that works on EUR/USD but fails on GBP/USD or fails in 2020 but worked in 2015 indicates regime dependence.
Cost sensitivity. This strategy enters and exits on almost every retest, meaning commissions and slippage are material. A 1% edge that disappears after commissions is not an edge. Commission and slippage settings in the backtest must match reality.
Unvalidated mechanism. The underlying logic, that institutional orders rest at 20-bar extremes and pull price back, is not verified. It is plausible, but plausibility is not evidence. Without order-flow data or actual institutional order placement records, this is conjecture.
Untested in live trading. This strategy paper presents a mechanical rule and code, but no historical backtest results. The code has not been run on real data to confirm that it achieves any positive expectancy. A reader must validate this themselves.
Key definitions
Order block: A consolidation zone (a range where price moved sideways) that preceded a directional move away from that range. In this strategy, defined mechanically as the highest high and lowest low over the last N bars.
Support/resistance: Price levels at which supply and demand are expected to be significant, causing price to pause, reverse, or consolidate. Often at prior swing highs/lows or round-number levels.
Retest: A return of price to a level it has previously left. In this strategy, price moves away from the order block, then closes back into the block zone.
ATR (Average True Range): A volatility measure calculated as the 14-bar average of the true range (the greatest of: high minus low, high minus prior close, or prior close minus low). Used here to scale the stop-loss to the instrument's typical volatility.
Risk-to-reward ratio (RR): The ratio of maximum loss (stop-loss distance) to maximum gain (target distance) in a trade. A 2:1 RR means the target is twice as far from entry as the stop-loss.
Profit factor: Total gross profit divided by total gross loss. A profit factor > 1.0 means the strategy is profitable; > 1.5 is generally considered strong.
Figures
References
-
Miner, Robert C., "High Probability Trading: Take the Guesswork Out of Trading," Wiley (2003)., Foundational work on support/resistance levels and swing analysis; establishes that price clusters recur at prior extremes, though does not isolate "order blocks" as a distinct category.
-
Bulkowski, Thomas N., "Encyclopedia of Chart Patterns," 2nd ed., Wiley (2005)., Peer-reviewed patterns including breakout/retest; retest continuation is documented as a tradable pattern in trending markets, but no evidence differentiates order blocks from other retest definitions.
-
De Bondt, Werner F. M., and Richard H. Thaler, "Does the stock market overreact?," Journal of Finance, 40(3), 793-805 (1985). DOI: 10.1111/j.1540-6261.1985.tb05004.x, Empirical evidence that prices revert to mean levels, supporting retest strategies; however, does not validate any particular definition of "the level."
-
Investopedia, "Support and Resistance," Investopedia, https://www.investopedia.com/terms/s/support.asp., General reference on support/resistance mechanics; practitioner-focused, not primary research.
-
Cboe Global Markets, "VIX Index," https://www.cboe.com/vix., Source for ATR context and volatility concepts; used to validate stop-loss scaling methodology. (primary)
Critical note: This strategy has not been backtested. No win rate, profit factor, or drawdown figures are claimed. A reader who wishes to trade it must test it independently on their own data, with realistic commission and slippage, over a representative sample of market conditions, and must accept that past results do not predict future performance.
Educational research on historical data only. Not investment advice, not a signal, and never a performance promise. Past results do not predict future performance. Every reference is link-verified before publication and every paper is re-audited weekly against the library's editorial standard.
Last reviewed by the PropLedger research pipeline: 2026-11-15. Educational research on historical data, not financial advice.
Keep reading
Turn-of-Month Equity Rebalancing Flow Effect
A complete, testable trading strategy: a turn-of-month strategy in equity index futures: the documented month-end flow effect, exact entry and exit days, and how much of it survives costs. Exact rules, full Pine Script code, and an honest reading of the evidence.
Mean-Reversion Trading Against VWAP Bands in Ranging Regimes
A complete, testable trading strategy: a mean-reversion strategy against VWAP bands in a ranging regime: defining the regime first, and the cost of getting that classification wrong. Exact rules, full Pine Script code, and an honest reading of the evidence.
Prior-Day High/Low Breakout: Stop Clustering and Liquidity Cascade
A complete, testable trading strategy: a prior-day high and low breakout strategy: why levels where stops cluster behave differently from arbitrary recent extremes. Exact rules, full Pine Script code, and an honest reading of the evidence.