Testing Popular Ideas · Lesson 12
SMC: liquidity sweeps (failed breakouts)
A price that runs past a level and comes back: how often it happens when there is nothing to find, and the 24 versions of a rule built on it.
Know the basics? Read the lesson notesPast the level, then back
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.
A liquidity sweep, also called a failed breakout, is a price that goes a little past a level many traders watch, then comes back within minutes. The level here is yesterday's low: the lowest price of the previous day's session (see the Previous day high and low lesson).
The prices 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; only the size of moves clusters, in calm and wild spells. So the counts in this lesson show what sweep rules produce when there is nothing to find. They cannot show whether the idea works in any real market.
Each five-minute bar below holds five minutes of trading: a thin line from its low to its high, a box from its open (its first price) to its close (its last price). Play the morning.
The first bars of one day, against yesterday's low (simulated)
Dashed: yesterday's low. Bars are named by the minute they start.
The 09:30 bar fell to 105.76, below yesterday's low of 105.88, and closed below it, at 105.84. The 09:35 bar closed back above, at 106.01: past the level, then back within ten minutes. (Later that day the price fell to 105.14.)
Why “liquidity”?
The name comes from a story about orders. Many traders leave stop orders just past such levels: orders that sell once the price falls to a set price (see the Orders lesson). Orders waiting to be filled are called liquidity. The story says large traders push the price past the level to trade against those orders, then let it turn. A test needs neither to believe nor to doubt the story. It needs exact words for “past” and “back”.
Take this lesson's first reading: any amount past, then a close back above within 15 minutes, which is the bar that went past and the next two. Yesterday's low was 50.00. Which is a sweep?
Three choices inside “swept”
Each word in the definition hides a choice.
- Which level. Yesterday's high or low, or a swing high or low: a day whose high is above the highs of the 5 days before it and the 5 days after it (a low below theirs; see the SMC: market structure lesson). The rule uses the latest one that no later day has gone past.
- How far past. Any amount, or at least 0.1%.
- How fast back. A close back on the near side (above a low, below a high) in the same bar, so only the bar's wick, its thin line, went past; within 15 minutes; or within an hour.
Try each switch on the same day.
One day, read by each switch (simulated)
Dashed: the chosen level. Marked: the bar that went past, and the close back.
On this day yesterday's low counts as swept under every reading except “same bar”: the 09:30 bar closed below it. The swing low, 104.41, was never reached. Each set of choices marks different days.
The Previous day high and low lesson's rejection reading, which trades against the level once the price has gone past and closed back, is one more version: any amount past, back at any time before 16:00.
How often, with nothing to find?
Before reading anything into a sweep, count how often one happens anyway: its base rate. Guess: on how many days in 100 is yesterday's low swept by any amount, with a close back above within 15 minutes?
Days with a sweep of yesterday's low that came back, by switch (simulated)
Pooled over 1,000 simulated markets: all their days counted together. Pale: any amount past. Dark: at least 0.1%.
On this simulated market, 766 of 2,606 days; on 1,000 more built the same way, 28.3 days in 100.
Yesterday's low was swept by any amount on 47.6 days in 100, and 59.4 in 100 of those sweeps closed back above within 15 minutes. Why so often? At the moment it crosses the level, a price with no pattern is as likely to go on as to turn, so it soon crosses back; the Theory card puts a number on it. A sweep of at least 0.1% starts further past, and then 31.4 in 100 came back within 15 minutes.
For the precise
Every day from the second to the last of ten years: 2,606 a market. Yesterday's high was swept by any amount on 50.9 days in 100, and 58.7 in 100 of those sweeps came back within 15 minutes. The swing levels sit further away: the swing low was swept on 4.0 days in 100, the swing high on 4.7. Of the sweeps of yesterday's low, 29.0 in 100 came on a day that opened below it (a gap).Back above, then what?
So a sweep that comes back is common. Does it say where the rest of the day goes? Buy at the close of the bar back above yesterday's low (within 15 minutes, as above), sell at 16:00. Of those trades, how many ended higher, before costs (leaving out what trading costs)?
The sweep and the turn back happened; what came after went either way. What a rule makes after costs, against just holding, is what a test reads.
How many versions?
Now the rule. At a low, buy at the close of the first bar back above the level. At a high, sell short (sell first and buy back later, which gains when the price falls) at the close of the first bar back below. Close the trade at 16:00. One trade a day at most.
Each different set of choices is a version: the same idea with different settings (the How we test an idea lesson). Four levels (yesterday's high and low, the swing high and low), two distances, three speeds: how many versions?
The first reading, yesterday's low, any amount past, back within 15 minutes (so it buys), is the baseline version: this lesson's starting point, not anyone's published rule.
One version against just holding
Run the baseline version from 2015 to 2021 against just holding: buying on the first day and 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 14.5% a year after costs; before costs it lost 0.3% a year. Even before costs it trailed holding, because it holds a position only until 16:00 and sits in cash otherwise. It traded on about 77 days a year, paying 0.1% to buy and 0.1% to sell each time.
A result's lead is its % a year minus holding's, in points (a point is 1% a year): here −14.5 − 4.4 = −18.9 points. One market is one draw, so run it on 1,000 more.
The baseline version's lead over holding on 1,000 simulated markets
Grey bars: markets by size of lead, after costs. Orange outlines: the same markets before costs.
Before costs it beat holding in 167 of the 1,000 simulated markets; after costs, in 1.
For the precise
Its lead averaged −6.97 points a year before costs and −20.67 after, across the 1,000 simulated markets; it traded on 72.9 days a year on average.All 24 versions
Here are all 24 versions on the same simulated market and years, 2015 to 2021. Show them, then turn the costs on.
24 versions: each one's lead over holding, 2015–2021 (simulated)
One bar per version, grouped by level; in each group, any amount past then at least 0.1%, each by same bar, 15 minutes, 1 hour. Above the line: beat holding. Black: the baseline version. Solid orange: the best.
On this market none of the 24 beat holding, before or after costs. The best after costs, the swing low with at least 0.1% past and back in the same bar, trailed holding by 4.1 points a year. It traded on only 9 days in seven years, so it held cash almost all the time and missed holding's rise. The baseline version came 21st of 24: its place, counting from the largest lead.
On the 1,000 simulated markets, after costs, at least one of the 24 beat holding in 168.
Does the best stay best?
Before any version was run, 2022 to 2024 were set aside: years held out, 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 the held-out years. A blind draw, a version picked at random, would be best there in about 42 of 1,000 (1,000 ÷ 24 = 41.7). Guess how often the best stayed best.
The best version's held-out place on 1,000 simulated markets, after costs
One bar per place, 1st on the left. Dashed: a blind draw.
The best stayed best in 116 of the 1,000 simulated markets, against a blind draw's 42.
Why 116? The best was nearly always a version that rarely trades: a swing level in 951 of the 1,000, at least 0.1% past in 857. It traded on about 3.0 days a year, against 29.8 for all 24 on average, so it paid the least in costs. Every version loses on costs each time it trades, so the one that trades least loses least in any years; that is why it stayed near the top. The fair comparison is with the least-trading version, not a blind draw. It beat holding on the held-out years in 202 markets, 193 of them markets where holding itself lost money there: cash beat a falling market. That is not skill, and it says nothing about a real market.
Why most sweeps come back: the Sparre Andersen theorem
Picture the price at the moment it crosses a level. Suppose each next move is as likely a rise of any size as a fall of the same size, independently of the others. The chance that the next n closes all stay past the level is then qn, whatever the size of the moves: the Sparre Andersen theorem (the SMC: market structure lesson used the same qn for swings). So the chance that at least one of those closes is back on the near side is 1 − qn.
- n
- the closes counted, starting with the bar in which the price crosses the level: 3 for 15 minutes of five-minute bars
- qn
- the chance all n closes stay past the level, when each move is as likely a rise of any size as a fall of the same size, independently, never exactly zero
- P(back within n closes)
- the chance at least one of them is back on the near side, for a price that starts at the level, under the same conditions
n = 3: q3 = ½ × ¾ × ⅚ = 5/16 = 0.3125, so 1 − 0.3125 = 0.6875: about 69 in 100. Across the 1,000 simulated markets, of the sweeps of yesterday's low by any amount on days that did not open below it (days with no gap: a day that opens past the level never trades at it), 72.6 in 100 closed back above within 15 minutes. Within an hour (n = 12): 86.1 counted, against 1 − q12 = 83.9.
- a rise of any size is as likely as a fall of the same size;
- moves are independent of each other;
- the price starts at the level: it crosses it rather than jumping past.
The price starts further past: a sweep of at least 0.1% (31.4 in 100 back within 15 minutes), or a day that opens past the level (a gap: 29.0 in 100 sweeps of yesterday's low began that way, left out of the 72.6). The counts sit a little above the rule because the crossing comes partway through a bar and the generator draws each bar's wicks. A real market needs its own count.
Within 10 minutes (n = 2), for a price that starts at the level in a market with no pattern: about how many in 100 come back?
What this means for your test
- Write every switch down before you run it.
Which level, and which hours make its day; how far past; how fast back; the entry, the exit and the costs.
- Count the base rate, then compare with just holding after costs.
With nothing to find, 59.4 in 100 sweeps of yesterday's low came back within 15 minutes in these simulated markets, yet after costs the baseline version beat holding in only 1 of 1,000.
- Count the versions, then hold out years.
24 here. After costs the best of 24 stayed best on held-out years in 116 of 1,000 simulated markets, against about 42 for a blind draw, because it traded least: not a sign that sweeps work.
A post's claim
What does the 85% leave out?
A bigger search
In about how many of the 1,000 would a blind draw be best?
Hint: first multiply the choices to get the number of versions, then divide 1,000 by it.
Half an hour to come back
For a price that starts at the level, about how many sweeps in 100 come back in time?
Hint: q6 = ½ × ¾ × ⅚ × ⅞ × 9/10 × 11/12. Then take 1 − q6.
Lesson done
A liquidity sweep is a price that goes past a watched level and comes back within minutes; which level, how far past and how fast back 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 sweep rules produce when there is nothing to find: yesterday's low was swept on about half of all days, and 59.4 in 100 of those sweeps came back within 15 minutes (72.6 when days that opened past the level are left out, against 68.75 from the Sparre Andersen theorem); after costs the baseline version beat just holding in 1 of 1,000 simulated markets, and the best of 24 stayed best on held-out years in 116 (a blind draw: about 42) because it traded least. The counts cannot show whether sweeps work in any real market.
Key ideas
- Liquidity sweep
- a price that goes past a watched level, then closes back on the near side within a set time; also called a failed breakout
- Liquidity
- orders waiting to be filled, such as stop orders resting just past a level
- Near side
- the side of the level the price came from: above a low, below a high
- Base rate
- how often something happens anyway, before any rule acts on it
- Version
- the same idea with different settings; count every one
Formulas
P(back within n closes) ≈ 1 − qn, qn = ½ × ¾ × … × (2n − 1) ÷ (2n), for a price that starts at the level, when each move is as likely a rise of any size as a fall of the same size, independently, never exactly zero (the Sparre Andersen theorem)