The rules at a glance
- Break of structure: a candle closes above the last swing high (for longs) or below the last swing low (for shorts)
- The order block: the last bearish candle before that break (last bullish candle for shorts), found within the 10 candles before it
- Strength check: the breaking candle closes at least 1.5 × ATR away from the far edge of the block
- Entry: a limit order at the near edge of the block (its high for a bullish block, its low for a bearish one)
- Stop loss and target: beyond the far edge of the block plus a quarter of the ATR; target twice the risk (2R)
- Cancel: if the order hasn't filled within 30 candles
What an order block is
Strong moves have to start somewhere. In SMC teaching, a bullish order block is the last down candle (a bearish candle) before a rally that breaks above a previous swing high. The story behind it is that large buyers were building their position during that last dip, and when the price comes back to it, they, or traders who expect them, buy again. A bearish order block is the last up candle before a fall that breaks a swing low.
You don't have to accept the story about institutions to use the level. A candle where a strong move began is a level that many traders now watch, and a pullback to it gives you a clear place for a stop: if the price goes back through the whole candle, the move has failed.
What makes a valid order block
Most charts are full of bearish candles followed by bullish ones. What separates an order block from any other candle is what happens next:
- It breaks structure. The move away from the candle has to close beyond the last swing point. Without a break of structure, it's just a candle. The BOS and CHoCH guide explains how structure is read.
- The move is strong. The script asks for the breaking candle to close at least 1.5 × the ATR away from the far edge of the block. Small, slow moves don't leave convincing blocks.
- It's the first return. The first time the price comes back to a block after the break is the one traders watch; a block the price has already traded back through is spent. The script only trades that first return.
Many SMC traders also like blocks that sit next to a fair value gap, or that formed right after a liquidity sweep. Those are extra filters you can test.
The rules, step by step
1. Wait for a break of structure
Mark the last swing high: a candle whose high is above the five candles on each side of it. For a long setup, wait for a candle to close above it.
2. Mark the block
Look back from the breaking candle for the most recent bearish candle, up to 10 candles back. Its high and low are the block. Check the move away was strong enough: 1.5 × ATR from the block's low to the breaking candle's close.
3. Place a limit order at the near edge
Put a buy limit at the block's high. That's the first price the pullback reaches. Some traders use the middle of the block (the "mean threshold") for a better price; it fills less often.
4. Stop beyond the block
The stop goes below the block's low, minus a quarter of the ATR. The target is twice the risk.
5. Cancel if it goes stale or breaks
If the order hasn't filled after 30 candles, cancel it.
Worked example: GBPUSD, 1-hour chart
GBPUSD sets a swing high at 1.3262, then slides for about ten hours. The last bearish candle of the slide runs from 1.3195 to 1.3217. Five bullish candles follow, and the fifth closes at 1.3270, above the swing high: a break of structure. The move from the block's low to that close is well over 1.5 × the ATR, so the block counts. A buy limit goes at 1.3217.
| GBPUSD long | |
|---|---|
| Entry (buy limit at the block high) | 1.3217 |
| Stop loss | 1.3192 (block low 1.3195 minus a quarter of the ATR), 25 pips away |
| Target (2R) | 1.3267, 50 pips away |
| Account and risk | $10,000, risking 1% = $100 |
| Lot size | $100 ÷ (25 pips × $10) = 0.40 lots |
| Loss if the stop is hit | $100.00 |
| Profit at the target | $200.00 |
The price rallies a little further, then pulls all the way back. 9 hours after the break, a candle dips into the block and fills the order. It holds above the block's low, and 7 hours later the target at 1.3267 is reached. The stop was 25 pips because the block itself was 22 pips tall; on a taller block, the same $100 buys a smaller position.
Adding a fair value gap to the block is a common filter; the XAUUSD FVG + order block strategy has the rules and a script.
Breaker blocks and mitigation blocks
Two related terms often come up alongside order blocks. Definitions vary from teacher to teacher, so here is the common version of each.
| Term | What it is | How traders use it |
|---|---|---|
| Order block | The last opposite candle before a move that breaks structure | Enter on the first return, stop beyond the block |
| Breaker block | An order block that failed: the price broke through it, usually after sweeping a high or low, and the block flipped sides | A broken bullish block is watched as resistance on the way back up, and the other way round |
| Mitigation block | Like a breaker, but the failed move didn't sweep a high or low first; it simply failed to make a new one | Watched the same way, as a level the price may react to on its return |
The idea behind both is the same as a break and retest: a level that held and then broke often acts from the other side on the way back. The script on this page trades only the first kind, the order block itself.
Risk management
- Size from the block. Tall blocks mean wide stops. Keep the risk fixed and let the lot size shrink.
- One block at a time. The script only keeps the newest block. Stacking orders at several blocks multiplies your risk if the move fails.
- Mind the session. Some traders give less weight to blocks formed in the thin Asian hours on GBPUSD than to ones formed in London or New York. Test that with the market hours in mind.
- Check the news. A release can push straight through a block that would have held on a normal day.
Common mistakes
- Marking blocks with no break of structure. Without the break, any candle could be called an order block.
- Picking the block after the fact. It's easy to find the "right" candle once you know where the price turned. Fixed rules, like the script's, stop you doing that.
- Trading a block the price has already returned to. The first touch is the setup; later touches are weaker.
- Stops inside the block. Pullbacks often dig deep into the block before they turn.
- Ignoring the higher timeframe. A bullish block on the 15-minute chart sitting under 4-hour resistance has a ceiling close above it.
Backtest it yourself on TradingView
This page doesn't quote a win rate or a profit figure, and you should be wary of anyone who does without showing the test. Results change with the market, the dates, the data feed and the costs you put in. The honest way is to run the test yourself, and the free script below does the work in a couple of minutes.
- Open the chart. On TradingView, open GBPUSD on the 1-hour chart.
- Add the script. Open the Pine Editor from the Pine icon in the panel on the right of the chart (older layouts have it as a tab under the chart), delete the code that's already there, paste this strategy's code and click "Add to chart".
- Put in your costs. Open the strategy's settings and go to Properties. Enter your broker's commission and a little slippage. A test without costs flatters every strategy, and short-term ones most of all.
- Read the Strategy Tester. The panel under the chart shows the net profit, the maximum drawdown, the profit factor, the number of trades and a list of every trade. Click a few trades and check on the chart that each one follows the rules. Trade sizes are shown in units rather than lots: 100,000 units is one lot of a forex pair, and 100 ounces is one lot of gold.
- Change one setting at a time. Try the swing strength (3 to 8 candles), how far back to look for the block, the minimum move away (1 to 2.5 × ATR), how long the order waits, and the stop buffer. Run the same settings on EURUSD and XAUUSD, and on the 15-minute chart.
As a rough guide, don't trust a result with fewer than 100 trades, a profit factor under 1 once costs are in, or a drawdown you couldn't sit through with real money. Settings tuned to look good on one stretch of history often fail on the next, so check the same settings on dates you didn't tune them on, then demo trade the strategy for a few weeks. How much history you can test depends on your TradingView plan: the free plan loads 5,000 candles, which is a few months of 15-minute candles but years of daily ones.
The script sizes each trade from the stop loss and your risk percentage, starts with $10,000 and assumes 1:100 leverage (a 1% margin setting), so the tester doesn't flag margin calls on normal forex trade sizes. Change these under Properties to match your account. By default TradingView fills orders at the open of the candle after the signal, so the fill can differ a little from the signal candle's close. Because entries are limit orders, the fill is almost always at your limit price, or better if a candle opens beyond it.
Download the free Pine Script and PDF
The script is written in Pine Script version 6 for this guide and follows the rules above. It can't read the economic calendar, so skipping news days is up to you. It's free to use, change and share. The PDF is a one-page cheat sheet with the rules, a worked example, the lot size maths and a checklist, to keep next to your chart.
Show the code (Pine Script v6, 103 lines)
//@version=6
// Order Block strategy by PipLedger (https://pipledgerfx.com/order-block-strategy)
// After a break of structure, marks the last opposite candle before the move (the order block) and trades the first return to it.
// Free to use and change. For education and backtesting only; not financial advice.
strategy("PipLedger: Order Block", shorttitle="Order Block", overlay=true, initial_capital=10000, pyramiding=0, default_qty_type=strategy.fixed, default_qty_value=1, margin_long=1, margin_short=1, currency=currency.USD)
// ---------- Inputs
swingLen = input.int(5, "Swing strength (bars on each side)", minval=2)
lookback = input.int(10, "Bars to search back for the order block candle", minval=2, maxval=50)
minMove = input.float(1.5, "Minimum move away from the block (x ATR 14)", minval=0.0, step=0.1)
validFor = input.int(30, "Candles the block stays valid", minval=1)
stopBuf = input.float(0.25, "Stop buffer beyond the block (x ATR)", minval=0.0, step=0.05)
rr = input.float(2.0, "Target (R multiple)", minval=0.5, step=0.25)
riskPct = input.float(1.0, "Risk per trade (% of equity)", minval=0.1, maxval=5.0, step=0.1)
// ---------- Helpers
fx = strategy.convert_to_account(1.0) // one unit of the chart's quote currency in account currency (1 on USD-quoted charts)
calcQty(float entry, float stop) =>
float dist = math.abs(entry - stop)
dist > 0 and not na(fx) ? strategy.equity * riskPct / 100 / (dist * syminfo.pointvalue * fx) : 0.0
// high and low of the most recent bearish (dir = -1) or bullish (dir = 1) candle before this one
lastCandle(int dir) =>
float h = na
float l = na
for i = 1 to lookback
if (dir == -1 and close[i] < open[i]) or (dir == 1 and close[i] > open[i])
h := high[i]
l := low[i]
break
[h, l]
atr = ta.atr(14)
ph = ta.pivothigh(high, swingLen, swingLen)
pl = ta.pivotlow(low, swingLen, swingLen)
[dnH, dnL] = lastCandle(-1)
[upH, upL] = lastCandle(1)
// ---------- Structure
var float swHi = na
var float swLo = na
if not na(ph)
swHi := ph
if not na(pl)
swLo := pl
bosUp = not na(swHi) and close > swHi and close[1] <= swHi
bosDn = not na(swLo) and close < swLo and close[1] >= swLo
if bosUp
swHi := na // each swing level breaks once
if bosDn
swLo := na
var float zTop = na
var float zBot = na
var int zDir = 0 // 1 = a buy order waits at a bullish block, -1 = a sell order waits at a bearish block
var int zBar = na
flat = strategy.position_size == 0
if not flat
zDir := 0
if zDir == 1 and (bar_index - zBar >= validFor or close < zBot)
strategy.cancel("Long")
zDir := 0
if zDir == -1 and (bar_index - zBar >= validFor or close > zTop)
strategy.cancel("Short")
zDir := 0
// bullish block: the last bearish candle before a close above the swing high, with a real move away from it
newLong = flat and bosUp and not na(dnL) and dnH < close and close - dnL >= minMove * atr
newShort = flat and bosDn and not na(upH) and upL > close and upH - close >= minMove * atr
// ---------- Orders: a limit order at the near edge of the block, stop beyond its far edge
if newLong
strategy.cancel("Short")
zTop := dnH
zBot := dnL
zDir := 1
zBar := bar_index
float sl = zBot - atr * stopBuf
float q = calcQty(zTop, sl)
if q > 0
strategy.entry("Long", strategy.long, qty=q, limit=zTop)
strategy.exit("Long exit", "Long", stop=sl, limit=zTop + (zTop - sl) * rr)
else if newShort
strategy.cancel("Long")
zTop := upH
zBot := upL
zDir := -1
zBar := bar_index
float sl = zTop + atr * stopBuf
float q = calcQty(zBot, sl)
if q > 0
strategy.entry("Short", strategy.short, qty=q, limit=zBot)
strategy.exit("Short exit", "Short", stop=sl, limit=zBot - (sl - zBot) * rr)
// ---------- Chart
plot(swHi, "Swing high", color=color.new(color.gray, 40), style=plot.style_linebr)
plot(swLo, "Swing low", color=color.new(color.gray, 40), style=plot.style_linebr)
plot(zDir != 0 ? zTop : na, "Block top", color=color.new(color.orange, 0), linewidth=2, style=plot.style_linebr)
plot(zDir != 0 ? zBot : na, "Block bottom", color=color.new(color.orange, 40), linewidth=2, style=plot.style_linebr)
plotshape(newLong, "Bullish break", shape.triangleup, location.belowbar, color.teal, size=size.small)
plotshape(newShort, "Bearish break", shape.triangledown, location.abovebar, color.red, size=size.small)Trading this from India
Residents can trade EURUSD, GBPUSD and USDJPY futures and options on NSE and BSE through a SEBI-registered broker. The contracts are quoted the same way as the spot pair, one lot is 1,000 units of the base currency, and they're cash-settled in rupees. They trade only from 9 a.m. to 7:30 p.m. IST, volumes are thin and not every broker offers them, so check the hours and the spread first. Trading forex or CFDs with offshore online platforms isn't allowed for residents under FEMA, even if the app is easy to download. Details are in is forex trading legal in India.
Related strategies: liquidity sweep, fair value gap, BOS and CHoCH, ICT kill zones, XAUUSD FVG + order block. All 34 strategies are compared on one page in forex trading strategies.