Testing Popular Ideas · Lesson 14
SMC: order blocks
The last candle before a strong move, and the saying that the price comes back to it: which candle, how strong a move, how often the price does come back when there is nothing to find, and the 24 versions of a rule built on it.
Know the basics? Read the lesson notesThe last candle before the move
Several lessons cover ideas that traders group under "smart money concepts" (SMC): fair value gaps, order blocks, liquidity sweeps, market structure. They spread through free video lectures and are now taught by many educators, each with their own definitions. We code one common reading, show the switches where readings differ, and test that. It is our reading, not anyone's official method.
Take candles in a row (a candle holds the open, high, low and close of one stretch of time; here, five minutes). When the price suddenly moves hard one way, the last candle that went the other way just before the move is called an order block. A popular saying is that the price tends to come back to it later.
The prices in this lesson are simulated: made up by a computer, not a real market. These markets were built so that past prices say nothing about which way the next move goes; the counts here show what order blocks and rules built on them do when there is nothing to find. They cannot show whether the idea works in a real market.
Five made-up candles, then a move up
Each candle: a line from its low to its high, a box from its open to its close, empty if it closed higher, filled if it closed lower.
Read as the last candle that closed lower before the move up, which one is the order block?
What counts as a strong move?
Traders call the strong move displacement, and define it in several ways. Three common ones: one candle whose body (its box, from open to close) is at least twice the average body of the 20 candles before it; at least three times; or a move so fast that the first and third of three candles in a row don't overlap, leaving a gap (the Fair value gaps lesson). The order block is looked for among the five candles before the move. The chart is one simulated day, 09:30 to 16:00. Try all three.
Every order block of one day, by displacement (simulated)
Each order block: its range, outlined from its candle to 16:00, numbered at its candle. Orange: before a move up. Grey: before a move down.
This day has 4, 2 and 4 order blocks. Across 1,000 simulated markets: 6.8, 1.9 and 9.0 a day. Each definition finds a different set.
Which candle, and which part of it
An order block marks a zone: the price range the price is said to come back to. Read from the wicks (the thin line), it is the candle's whole range, low to high; read from the body, only its box. Which candle is a choice too: the last one that went the other way, or the one with the lowest low of the five before the move. Below: this day's first move up that left a gap, at 10:45. Each bar is one candle, named by the time it starts. Try both switches.
One move, four zones (simulated)
Ring: the chosen candle. Shaded: its zone.
The last candle that closed lower is the 10:30 bar: zone 106.10 to 106.16 from the wicks, 106.11 to 106.16 from the body. The lowest low is the 10:20 bar, which closed higher: 106.00 to 106.17, or 106.06 to 106.15. One move, four zones, from 0.05 to 0.17 tall.
How often does the price come back?
From here on: the last candle that went the other way, a move that leaves a gap, the zone from the wicks. The zone's side nearer the price is its near edge, the other side its far edge. On the day you saw, the move was complete at the 10:50 candle's close, 106.22, above the zone of 106.10 to 106.16. Guess: of 100 order blocks, how many are touched again (a later bar reaches the near edge) by 16:00 the same day?
Order blocks the price came back to by 16:00, of 100 (simulated)
Counted over 1,000 simulated markets: a later bar reached the near edge (touched), the zone's middle, or the far edge (gone through).
Across the 1,000 simulated markets, 80.0 order blocks in 100 were touched by 16:00; in 70.1 the price got as far as the zone's middle, and in 61.7 all the way through it. On the day shown, the next bar touched it.
Why so often? The move has only just left the zone, so the near edge sits close to the price, and the price has hours left to wander. Is the zone pulling it back, or is any level that close reached as often? The next card checks.
The mirror test
For each order block, take each level's distance from the price when the move is complete, and put a mirror level the same distance on the other side. On the day you saw, the near edge, 106.16, was 0.06 below the price of 106.22, so its mirror is 106.28. Nobody calls a mirror level an order block. If order blocks pull the price back, their levels should be reached more often than their mirrors.
Order-block levels and their mirror levels reached by 16:00, of 100 (simulated)
Orange: the order blocks' levels. Grey: the mirror levels. 1,000 simulated markets.
The mirror levels were reached almost as often: 79.7 in 100 against 80.0 touched; 70.0 against 70.1 at the middle, 61.4 against 61.7 gone through. In these markets the return rate is mostly a base rate (how often something happens anyway, before any rule acts on it): a level that close is reached that often, order block or not. (On the day shown, the near edge's mirror was never reached.)
The order blocks' share touched was still 0.3 in 100 higher on average (higher in 787 of the 1,000 markets). The Theory card asks whether that is luck, and where it comes from.
For the precise
The same 100 markets with the setting used here (bridge "normal"): 80.0 touched against 79.7 mirrors; with the pull-back setting (bridge "t"), gone through 61.7 against 60.7. Highs and lows: this simulation draws a bar's high and low a random distance beyond its open and close rather than from a price path. In 19,990 sessions of a plain random walk with the same bar sizes, highs and lows from the path gave 11.42 order blocks a day, touched 78.0 in 100 with mirrors 78.0; the generator's way gave 10.68, 79.5 and 79.4. The drift: order blocks before a move up were touched 79.7 times in 100 against 80.0 for their mirrors, before a move down 80.4 against 79.4. Opens: each bar opens where the one before closed; in 41.7 in 100 order blocks the candle was the bar right before the displacement bar, which then opened exactly at the candle's close. Each market's touched share ran from 79.3 to 80.8 in 100.A rule, and its versions
A rule built on the idea: take the day's first order block. Before a move up, an order waits to buy at the middle of the zone; before a move down, it does the mirror image (sells first and buys back later, which gains when the price falls). A stop, a set price that ends a losing trade, sits at the far edge. Every trade ends by 16:00. One more choice: when is the zone used up (no longer valid, so the waiting order is cancelled)? At its first touch (if the bar that reaches the near edge doesn't also reach the middle, no trade that day), or only when a bar closes beyond the far edge, so the order keeps waiting.
Each set of choices is a version: the same idea with different settings (the How we test an idea lesson). Candle (two), displacement (three), zone (two), used up (two): how many versions?
One version against just holding
Start with one exact rule: the last opposite candle, displacement that leaves a gap, the wick zone, used up at the first touch. Call it the baseline version: this lesson's starting point, not anyone's published rule. On the day you saw, it bought at 106.13 in the 10:55 bar, and the stop at 106.10 ended the trade in the 11:05 bar.
It runs from 2015 to 2021 against just holding (buying once, never selling). Each buy and each sale costs 0.1% of the price (the Costs lesson); holding pays that once. Results are in % a year: the steady yearly growth that gives the same total. Holding made 4.4% a year. Where did the baseline version end, after costs?
The baseline version and just holding, 2015–2021, after costs (simulated)
Accounts starting at 100. Orange: the baseline version. Dotted: holding.
It lost 11.0% a year after costs. It traded on 62 days a year, paying 0.1% to buy and 0.1% to sell each time. Each of those days keeps 0.998 of the account; 0.998 multiplied 62 times is 0.88, so costs alone take about 12% of the account a year. Before costs it made 0.8% a year.
One market is one draw, so run it on 1,000 more.
The baseline version against holding on 1,000 simulated markets, 2015–2021
Bars: markets, by the version's % a year minus holding's. Grey: after costs. Orange outline: before costs.
On 2015–2021 it beat holding before costs in 131 of the 1,000 simulated markets; after costs, in 2. Its trades averaged +0.0002% before costs: about zero.
For the precise
Against holding it averaged −8.35 points a year before costs and −20.02 after on 2015–2021, and −20.45 after costs on 2022–2024, where it beat holding in 30 of the 1,000 simulated markets. 91.9 in 100 of its trades ended at the stop and 8.0 in 100 gained. Holding owns this simulated market's slow rise day and night; the rule is in the market for part of some days and sells short about half the time.All 24 versions
Here are all 24 versions on the same simulated market and years, 2015 to 2021. Each bar is a version's % a year minus holding's, its lead, in points (a point is 1% a year). Show them, then turn the costs on.
24 versions: each one's lead over holding, 2015–2021 (simulated)
One bar per version, grouped by candle, then by displacement (2 ×, 3 ×, gap). In each set of four: wick zone then body zone, each used up at the first touch, then when closed through. Above the line: beat holding. Black: the baseline version. Solid orange: the best.
On this market none of the 24 beat holding on 2015–2021, before or after costs. The best after costs took the candle with the lowest low (highest high, before a move down), 3 × the average body, the wick zone and the first touch: −11.6 points a year. The baseline version came 5th: its place, counting from the largest lead.
The six with the largest leads after costs are the six that traded least here, wick zones used up at the first touch: 38.5 to 70.7 days a year, against 96.5 to 213.1 for the other 18. Every trade pays costs, so on a market with nothing to find, trading less loses less. On the 1,000 simulated markets, after costs, at least one of the 24 beat holding on 2015–2021 in 14.
Does the best stay best?
Before any version was run, 2022 to 2024 were set aside: years held out (set aside, to be used once; the held-out test lesson). On each of the 1,000 simulated markets we took the best of the 24 on 2015–2021, after costs, and ran it once on 2022–2024.
Two comparisons. A blind draw, one version taken at random, would be best there in about 42 of 1,000 (1,000 ÷ 24 = 41.7). But the best was mostly the version that trades least: the same one in 817 of the 1,000 markets, trading on 37.9 days a year against 132.6 for the 24 on average. So the fair comparison is the least-trading version, chosen in advance by its number of trading days on 2015–2021, without looking at its results. Guess how often the best stayed best.
The best version's place on 2022–2024, on 1,000 simulated markets, after costs
One bar per place, 1st on the left. Dashed: a blind draw. Dotted: the least-trading version, best in this many markets.
The best stayed best in 592 of the 1,000 simulated markets. The least-trading version, chosen without looking at any result, was best there in 662; a blind draw, in about 42. Picking by results did no better than counting trades: the best stayed on top mostly because it traded least. It is not skill, and it says nothing about a real market.
For the precise
On 2022–2024, after costs, the best beat holding in 75 of the 1,000 simulated markets, all 75 of them markets where holding itself lost money there (holding lost in 229 of the 1,000): cash beat a falling market. The least-trading version beat holding in 76, all of them markets where holding lost. The best was the least-trading version in 817 markets; it took the candle with the lowest or highest extreme in all 1,000 and was used up at the first touch in all 1,000. Average held-out place: the best 1.5, the least-trading version 1.4. No market had a tie for first place.Is a small difference luck? The standard error
The order blocks were touched 0.3 times in 100 more often than their mirrors. To ask whether that is luck, measure the difference in each of the 1,000 markets and average them. An average of n independent numbers spreads around its true value by their standard deviation divided by √n: the standard error (the Sampling error lesson). Dividing the average by it, z, says how many standard errors it sits from zero. On the bell curve (the usual hump-shaped spread of luck), beyond 2 either way happens about 5 times in 100 if only luck is at work.
- n
- the number of independent measurements (here, markets)
- s
- their standard deviation: how far a typical one sits from their average
- SE
- the standard error: how far luck typically moves the average of n such measurements
- z
- how many standard errors the average sits from zero; for an average of many independent measurements, beyond 2 either way happens about 5 times in 100 if only luck is at work
Each market's touched share minus its mirror share, in order blocks per 100: average 0.301, standard deviation s = 0.380, n = 1,000. SE = 0.380 ÷ √1,000 = 0.380 ÷ 31.6 = 0.0120. z = 0.301 ÷ 0.0120 = 25: far beyond luck.
So where does it come from? The first 100 of the markets, rebuilt with a first price of 100,000 so that rounding prices to the cent no longer matters, gave 80.0 touched against 80.1 for the mirrors; at the usual price the same 100 gave 80.0 against 79.7. Once rounding to cents was removed, the lead vanished, so it most likely came from rounding, not from order blocks.
- the measurements are independent of each other (separate markets, not overlapping stretches of one);
- there are enough of them for their average to follow the bell curve (dozens or more).
Measurements that move together make the true spread wider than s ÷ √n. And a large z only says a difference is not luck; it does not say what made it. Here it was how the prices were built.
Across 400 simulated markets, the differences average 0.5 in 100 with a standard deviation of 4 in 100. How many standard errors is the average from zero?
What this means for your test
- Write the exact definition before you count.
Which candle; what counts as displacement; a wick or body zone; when it is used up; and, for a rule, the entry, the stop and the costs.
- Compare the return rate with a base rate, and the rule with just holding after costs.
In these simulated markets 80.0 order blocks in 100 were touched and their mirror levels were reached 79.7 times in 100. The baseline version beat holding after costs on 2015–2021 in 2 of 1,000.
- Count the versions, hold out years, and compare the best with the least-trading version.
24 here. The best of 24 stayed best on held-out years in 592 of 1,000 simulated markets; the least-trading version, chosen in advance, was best in 662; a blind draw, about 42. The best stayed on top mostly because it traded least: not a sign that order blocks work.
"Price always returns"
Which count would tell you whether order blocks pull the price back?
A seller's difference
How many standard errors is the average of 2 in 100 from zero?
Hint: first work out SE = s ÷ √n, then divide the average by it.
The best of 30
What should they compare the 300 with?
Lesson done
An order block is the last candle that went the other way before a strong move; which candle, what counts as a strong move (displacement), a wick or body zone and when it is used up are choices, and they made 24 versions here. These simulated markets were built so that past prices say nothing about which way the next move goes, so the counts show what happens when there is nothing to find: 80.0 order blocks in 100 were touched again the same day, and mirror levels the same distance on the other side were reached 79.7 times in 100; the remaining 0.3 in 100 vanished once rounding prices to cents was removed, so it most likely came from that rounding. After costs the baseline version beat holding on 2015–2021 in 2 of the 1,000 simulated markets. The best of 24 stayed best on held-out years in 592, mostly because it traded least: the least-trading version, chosen in advance, did so in 662 (a blind draw: about 42). The counts cannot show whether order-block rules work in any real market.
Key ideas
- Order block
- the last candle that went the other way before a strong move (one common reading); another reading takes the candle with the lowest low (highest high) before it
- Displacement
- the strong move itself; defined, among other ways, as a candle body at least 2 or 3 times the recent average, or a move that leaves a fair value gap
- Zone, near edge, far edge
- the order block's price range, from its wicks or its body; its side nearer the price, and the other side
- Mirror level
- a level the same distance from the price on the other side; the base rate an order block's return rate is compared with
- Least-trading version
- the version with the fewest trading days, chosen before looking at results; the fair yardstick for a best version when costs favour trading less
Formulas
SE = s ÷ √n: the standard error of an average of n independent measurements whose standard deviation is s
z = average ÷ SE: how many standard errors an average sits from zero; for many independent measurements, beyond 2 either way about 5 times in 100 by luck