Testing Popular Ideas · Lesson 11
SMC: market structure
Swing highs and lows, breaks of structure and changes of character: how often they appear when there is nothing to find, and the 24 versions of a rule built on them.
Know the basics? Read the lesson notesSwing highs and swing lows
Smart money concepts (SMC) are a set of chart-reading terms popular online. 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. Market structure comes first; the others each get their own lesson.
Market structure starts from turning points. Each mark below is one day: a thin line from its lowest price to its highest, and a box from its first price (the open) to its last (the close). A swing high is a day whose high is above the highs of the n days before it and the n days after it; a swing low is a day whose low is below theirs. The number n is the swing's width, and it is a choice. A swing high is known only n days later, once the days after it are in.
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; the counts in this lesson show what structure rules do when there is nothing to find. They cannot show whether the idea works in a real market. Try all three widths.
100 days, daily candles (simulated)
Filled dot: a swing high. Ring: a swing low. Short dashed line: the days until the swing is known.
Width 2 marks 13 swing highs and 15 swing lows in these 100 days; width 10 marks 1 and 3. The same prices give a different picture of where the turns were.
Higher highs, higher lows
Traders read the swings in order. A swing high above the swing high before it is a higher high; a swing low above the one before it, a higher low. Higher highs and higher lows are read as a rise; lower highs and lower lows as a fall. Reading the swings this way is reading the market's structure.
The same 100 days, width 5 (simulated)
HH: higher high. LH: lower high. HL: higher low. LL: lower low.
In markets built with no pattern, what share of swing highs (width 5) is above the swing high before it?
So runs of higher highs and higher lows turn up with nothing to find. Reading them as a rise describes the past; it does not say where the next move goes in these markets.
Break of structure, change of character
A rule needs a moment to act. Keep a trend: up, down, or none at first. Each day, look at the latest swing high and swing low that are already known. A close above that swing high breaks it upward; a close below that swing low breaks it downward. Each swing can break only once.
The first break sets the trend. After that, a break in the trend's direction is a break of structure (BOS), and the trend stays. A break against it is a change of character (CHoCH), and the trend flips. Step through the breaks on these 100 days, width 5.
Breaks on the 100 days, width 5 (simulated)
Dashed: the level that broke, from its swing to the break. Shading: the trend after each break (orange up, grey down).
Six breaks in 100 days: the first on 9 Feb (down), a change of character up on 16 Feb, two breaks of structure up, a change of character down on 28 Mar and a break of structure down on 27 Apr.
Close or wick
Two more choices. The swings can be read from each day's high and low, the wicks (the thin lines), or from the closes. A break can need a close past the level, or only a wick past it. Try both of each, at width 5.
Two readings of one break (simulated)
The breaks of the reading chosen with the two switches; switch them to compare. Shading: the trend.
With wick swings and close breaks, the trend changed character twice, on 16 Feb and 28 Mar. With close swings and close breaks, the first break came only on 27 Feb, and the one change of character on 24 Mar.
Which low must break?
In a rising trend, which low must break for a change of character? One reading takes the latest swing low. Another takes the low that the last rise started from: the lowest price between the swing high just broken and the break. That low usually sits further down, and the small dips after it don't count. A falling trend works the same way with highs. Try both at width 2, where they often differ.
Two choices of level, width 2 (simulated)
Wick swings, close breaks; switch Level to compare. Shading: the trend.
With the latest swing, five changes of character in 100 days. With the start of the move, two: the dips in between no longer flip the trend.
How many versions?
Each different set of choices is a version: the same idea with different settings (the How we test an idea lesson). Width (2, 5 or 10 days), swings from wicks or closes, a break by close or wick, the latest swing or the start of the move: how many versions?
How often, with nothing to find?
Take one exact reading: width 5, swings from the wicks, a break by a close, the latest swing. Call it the baseline version: this lesson's starting point, not anyone's published rule.
Guess: in a market built with no pattern, how many changes of character a year does it find?
Breaks a year with nothing to find (simulated)
Averaged over 1,000 simulated markets and ten years. Wick swings, close breaks, latest swing, at each width. Pale: breaks of structure. Dark: changes of character.
Across 1,000 simulated markets, the baseline version found 6.2 changes of character a year, and as many breaks of structure; on the lesson's 10-year market (not the 100 days above), 6.9 a year.
Did a change of character mark a turn? After one, the next break went the new way, a break of structure, 49.6 times in 100, and flipped back the other 50.4: a coin toss, in these markets.
For the precise
Ten years of 2,607 days in each market. Wick swings, close breaks, latest swing: width 2, 13.1 breaks of structure and 12.3 changes of character a year; width 5, 6.2 and 6.2; width 10, 3.3 and 3.4. With the start of the move at width 5, 3.8 changes of character a year, and after one the next break was a break of structure 71.4 times in 100: that level sits further away, so the next break is more often the near swing in the new direction. Swing highs at width 5 (wicks): 15.4 a year.One version against just holding
A rule built on the baseline version: own the market while the trend is up; hold cash while it is down or not yet set. Decide at each close; buy or sell at the next day's open.
It runs from 2015 to 2021 against just holding: buying once 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 rule 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 3.7% a year after costs, 8.1 points a year behind holding (a point is 1% a year). Costs were not the main reason: it bought 3.6 times a year and sold as often, about 0.7 points a year. One market is one draw, so run it on 1,000 more.
The baseline version against holding on 1,000 simulated markets
Bars: markets, by the version's % a year minus holding's. Grey: after costs. Orange outline: before costs.
After costs it beat holding in 175 of the 1,000 simulated markets. The reason it mostly trailed: across these markets holding made 8.2% a year on average, and the rule held cash on about 44 days in 100, so it missed about 0.44 × 8.2 ≈ 3.6 points a year of the rise. Its average lag was 3.75 points a year before costs and 4.38 after. The 175 are mostly markets where holding did poorly: in 150 of them holding made less than its 8.2% average (holding was under 8.2 in 520 of all 1,000 markets; when holding earns little or falls, sitting in cash costs little or even helps).
For the precise
Before costs it beat holding in 200 of the 1,000 simulated markets. Holding (2015–2021, after its one cost) rose in 876 of the 1,000; where it fell by more than 5% a year (32 markets), the rule beat it after costs in 25. It was long on 55.9 days in 100 and bought 3.14 times a year, on average. Its opposite, the same structure owning the market only while the trend was down, beat holding before costs in 218 of the 1,000 (average lead −4.79). On the market shown, that opposite beat holding by 3.7 points a year after costs.Again: these markets have nothing to find, so this shows what the rule does then, not whether it works in a real market.
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, in points. Show them, then turn the costs on.
24 versions: each one's lead over holding, 2015–2021 (simulated)
One bar per version, grouped by width. Above the line: beat holding. Black: the baseline version. Solid orange: the best.
On this market 2 of the 24 beat holding before costs, and none after. The best after costs (solid orange) trailed holding by 1.9 points a year. It was the best before costs too, +1.6, and it traded most, 16.9 buys a year, so costs took about 3.5 points a year from it. The baseline version came 18th of 24: its place, counting from the version furthest ahead of holding.
On the 1,000 simulated markets, after costs, 3.9 of the 24 beat holding on average, and at least one did in 492.
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 2022–2024. A blind draw, one version taken 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 place on 2022–2024, on 1,000 simulated markets, after costs
One bar per place, 1st on the left. Dashed: a blind draw.
The best stayed best in 47 of the 1,000 simulated markets, against a blind draw's 42: 47 against 42 is within chance, since about ±6 either way is noise, and these markets have nothing to find, so it is not skill.
On 2015–2021 the best looked level with holding: −0.03 points a year on average. On 2022–2024 it trailed by 4.41, about what the baseline version did (−4.07). Its result did not carry over.
For the precise
The best on 2015–2021 had width 10 in 457 of the 1,000 simulated markets, 2 in 272, 5 in 271; it beat holding there in 492 and on 2022–2024 in 263; its average place on 2022–2024 was 12.2 of 24. One market had a tie for first place on the held-out years. Of all 24,000 held-out results after costs, 25.3 in 100 beat holding.How many swings a market with no pattern makes
Swings need no pattern. Suppose every day brings the same kind of move, as likely a rise of any size as a fall of the same size, independently of the other days, and never exactly zero. A close is a swing high (close reading, width n) when the price stays below it for each of the next n days and was below it for each of the n days before. Each side has the same chance, qn, and the two sides don't affect each other, so the chance is qn squared. That qn does not depend on the size of the moves is the Sparre Andersen theorem.
- n
- the width: the days on each side
- qn
- the chance the price stays below a given close for each of the next n days, when every day brings the same kind of move, as likely a rise of any size as a fall of the same size, independently, never exactly zero
- P(swing high)
- the chance a given close is a swing high of width n (close reading), under the same conditions; a swing low has the same chance
q2 = ½ × ¾ = 3/8, not ½ × ½: the price only has to stay below, so down 1% then up 0.5% still counts. P = (3/8)² = 9/64 = 0.141: about 14.1 closes in 100 are swing highs. Across the 1,000 simulated markets, 13.9 in 100 were (width 2, close reading); at width 5, 6.0 against (63/256)² = 6.1.
- the same kind of move every day, a rise of any size as likely as a fall of the same size;
- days are independent (one day's move tells you nothing about the next);
- no two closes exactly equal (no move is exactly zero).
A drift (these markets rise slowly), calm and wild spells (the size of moves clusters) or prices rounded to cents (ties: equal ±$1 steps would give ¼, not 3/8, at width 2) make it a little off: the counts here sit just under it. Swings read from wicks need other numbers, since a day's high is not its close. A real market needs its own count.
Width 3, in a market with no pattern: about how many closes in 100 are swing highs?
What this means for your test
- Write every switch down before you run it.
The width; wicks or closes for the swings; a close or a wick for the break; which low counts; when the rule buys and sells; the costs.
- Count how often it fires with nothing to find, then compare with just holding after costs.
With nothing to find, the baseline version found about 6 changes of character a year, and after costs it beat holding in only 175 of 1,000 simulated markets; it mostly trailed because it held cash about 44 days in 100 while these markets rose on average.
- Count the versions, then hold out years.
24 here. After costs the best of 24 stayed best on held-out years in 47 of 1,000 simulated markets, against about 42 for a blind draw.
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.
Every top marked
What is the likeliest problem?
Counting swings
About how many swing highs should they expect?
Hint: q4 = ½ × ¾ × ⅚ × ⅞. Square it, then multiply by 250.
Lesson done
Market structure reads swing highs and lows of a chosen width: a break in the trend's direction is a break of structure, a break against it a change of character. The width, wick or close, and which low counts 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 these rules produce when there is nothing to find: the baseline version found about 6 changes of character a year, after which the next break went either way about equally often; owning the market only in an up trend beat just holding after costs in only 175 of 1,000 simulated markets; it mostly trailed because it held cash about 44 days in 100 while these markets rose on average; the best of 24 stayed best on held-out years in 47 (a blind draw: about 42). In a market whose days are independent, each as likely a rise of any size as a fall of the same size, swings appear at a rate the Sparre Andersen theorem gives. The counts cannot show whether market structure works in any real market.
Key ideas
- Swing high, swing low
- a day whose high is above (low is below) those of the n days either side; known only n days later
- Width
- the n days on each side a swing needs; a choice
- Break of structure (BOS)
- a break of the latest swing level in the trend's direction; the trend stays
- Change of character (CHoCH)
- a break against the trend; the trend flips. Which low or high counts is a choice
- Wick, close
- reading swings or breaks from a day's high and low, or from its close
- Version
- the same idea with different settings; count every one
Formulas
P(swing high) = qn2, qn = ½ × ¾ × … × (2n − 1) ÷ (2n), for closes, width n, when every day brings the same kind of move, as likely a rise of any size as a fall of the same size, independently, never exactly zero (the Sparre Andersen theorem)