Quant from Scratch by QuantWright

Testing Popular Ideas · Lesson 15

Confluences: stacking conditions

Four conditions from earlier lessons stacked on one breakout rule: 256 versions, fewer trades and a wider error bar with every condition, and what is left of the best win rate on years set aside.

Know the basics? Read the lesson notes

Conditions that must all agree

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.

Traders who use these ideas often wait until several of them point the same way. They call that confluence, and a common claim is that each added condition raises the win rate: the share of trades that end ahead. Here a stacked rule takes a trade only when every condition on its list agrees with it.

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 stacked rules do when there is nothing to find about which way prices go. They cannot show whether confluence works in a real market.

Start with the number of trades. A rule trades on 260 days a year. You add a condition that agrees with about half of its trades, then a second one like it. About how many trades a year are left?

That is after the first condition. The second keeps about half of those 130 again.
Each condition keeps about half of what is left: 260 × ½ × ½ = 65. Every condition you stack shrinks the sample (the trades a test can count).
A condition that agrees half the time drops half the trades, and the second halves what is left: 260 × ½ × ½ = 65.

The rule underneath

The rule is the baseline version from the Opening-range breakout lesson, unchanged; call it the plain rule. The opening range is the highest and lowest price from 09:30 to 10:00. After 10:00, if the price reaches the range's high first, the rule buys; if it reaches the low first, it sells short (sells first and buys back later, so the trade gains when the price falls). A stop, a set price that ends a losing trade, sits at the other side of the range; otherwise the trade ends at 16:00. Each buy and each sale costs 0.1% of the price (the Costs lesson), and a trade counts as a win only if it ends ahead after those costs.

On 2 Jan 2017 this lesson's simulated market broke the range's high at 10:15, so the rule bought at 106.42. Did the trade win?

The plain rule on 2 Jan 2017, five-minute bars (simulated)

Each bar: a thin line from its low to its high, a box from its open to its close (empty if it closed higher). Shaded: the opening range. Dot: the entry. Ring: the exit.

Your guess
Entry106.42
Exit?
After costs?

It lost. The price ended the day at 106.43, one cent above the entry: +0.01% before costs, −0.19% after the 0.2% the trade paid to buy and sell.

On 2015 to 2021 the plain rule traded on 260 days a year on this market, and 31.7 in 100 of its trades won after costs. Across 1,000 simulated markets: 31.0 in 100.

Two conditions read before the day starts

The first two are read from daily bars (one bar a day: its open, high, low and close) of days that have already closed, so they are known before 09:30.

Daily trend (the Higher-timeframe filter lesson): keep a buy only if the trend reads up, a short sale only if it reads down, where "up" is one of three readings: yesterday closed above its own open (its colour), above its 20-day average, or the 10-day average is above the 30-day one.

Market structure (the SMC: market structure lesson): a trend read from turning points. The trend turns up when a day closes above the latest peak (a day whose high tops the 2, 5 or 10 days either side of it: the width) and down when a day closes below the latest trough. Keep a trade only if it goes the trend's way.

The 30 days before 2 Jan 2017 (simulated)

Daily bars: a thin line from low to high, a box from open to close, filled if the day closed below its open, empty if above. Line: the average of the last 20 closes. Orange: yesterday, 30 Dec.

Colour–
Above average–
Structure, width 5–

That morning the plain rule bought. Which of two settings keep the buy: the daily trend read by colour, and market structure with width 5?

Yesterday's bar closed below its open, so the colour reads down and drops a buy. Market structure read up and keeps it.
The other way round: yesterday closed below its open, so the colour reads down and drops the buy; market structure read up and keeps it.
The colour reads down (yesterday closed below its open) and drops the buy; market structure read up and keeps it. Two readings of "the trend" disagreed on the same morning.

Two conditions read inside the day

Session window (the Session windows lesson): keep a trade only if it starts inside a window of New York clock time: 10:00–10:30, 10:00–11:00 or 10:00–12:00.

Fair value gap (the SMC: fair value gaps lesson): three five-minute bars in a row where the third bar's low is above the first bar's high, leaving an empty space between them; that is an up gap, and the same upside down is a down gap. Keep a buy only if an up gap finished before the entry (a short sale needs a down gap). Three settings for how big the gap must be: any size, 0.05% or 0.10% of the price.

2 Jan 2017, 09:30 to 11:00 (simulated)

Shaded grey: the opening range. Orange bands: the up gaps that finished before the entry. Dot: the entry.

The buy came at 10:15. Before it, two up gaps finished: one of 0.02% and one of 0.10%. Does the buy pass the strictest settings, the 10:00–10:30 window and a gap of at least 0.10%?

10:15 is inside 10:00–10:30, and the 0.10% up gap finished before the entry, so both keep the buy.
The gap passes too: the second up gap was 0.10% and finished before 10:15.
The window passes too: 10:15 is inside 10:00–10:30.

How many versions?

A version is the same idea with different settings (the How we test an idea lesson). Here each of the four conditions is either off or on with one of its three settings, and a version takes the plain rule's trade only on days when all its switched-on conditions agree.

How many versions are there, counting the plain rule itself (all four off)?

3 × 3 × 3 × 3 = 81 counts only the versions with all four on. Each condition can also be off: four choices each.
4 × 4 = 16 covers two conditions. There are four.
Each condition has four choices (off or one of three settings): 4 × 4 × 4 × 4 = 256. By how many are on: 1 with none, 12 with one (4 conditions × 3 settings), 54 with two (6 pairs × 3 × 3), 108 with three, 81 with all four.

Fewer trades, wider error bars

Take one stack and add its conditions one at a time: the daily trend by colour, the 10:00–11:00 window, market structure with width 5, then a gap of at least 0.05%. Call it the baseline stack: this lesson's starting point, not anyone's published rule. It ran on the same 1,000 simulated markets, 2015 to 2021, after costs.

Each column's vertical bar is an error bar: the range that held the middle 95 of its 1,000 win rates. Every market ran the same rule, so the bar shows how far chance moves a win rate. Add the conditions.

The baseline stack, one condition at a time, 2015–2021, after costs (1,000 simulated markets)

Top: the middle 95 of 100 win rates, dot at the overall rate. Bottom: trades a year. Under each column: how many of the 256 versions have that many conditions (for example, 12 of the 256 have one).

Conditions0
Trades a year–
Error bar–

From 260 trades a year to 21, and the error bar from 28.7–33.5 to 27.0–42.6: more than three times as wide. The theory card next says why it widens by that much.

Theory

The error bar of a win rate

A win rate is an average: count a win as 1 and a loss as 0. Its standard error is how far chance typically moves it from the rate the rule would show over endless trades (the Sampling error and confidence intervals lesson). On a bell curve, the hump-shaped spread of many random results, about 95 in 100 land within 2 standard errors of the middle, so the error bar is the win rate ± 2 standard errors. Fewer trades give a wider bar, by the square root of how many times fewer.

SE = √(p × (1 − p) ÷ n)  ·  error bar = p ± 2 × SE
p
the win rate as a fraction (35 in 100 = 0.35)
n
the number of trades
SE
the standard error of the win rate, as a fraction (× 100 for points: 0.01 is one point)
Worked example: the four-condition stack

It won 34.9 in 100 of an average of 146.8 trades: p = 0.35, n = 147. 0.35 × 0.65 = 0.2275; ÷ 147 = 0.00155; √0.00155 = 0.039, so SE = 3.9 points and the error bar is ± 7.9 points. Across the 1,000 simulated markets its win rates had a standard deviation (their typical distance from the average) of 3.9 points, and the middle 95 ran 7.8 points either side.

From 1,817 trades to 147 is about 12 times fewer; √12.4 = 3.5, which is why the bar grew more than three times as wide.

Holds when
  • each trade's result doesn't change the next one's;
  • the rule's true win rate stays the same through the test;
  • the win rate was measured once, as planned, not picked as the best of many.
Breaks when

A search keeps the best of many versions: the one it keeps is the luckiest, and its bar sits too high (the next cards, and the Best of many lesson).

A backtest won 40% of its 96 trades. How wide is its error bar either side, in points?

Hint: work out SE = √(p × (1 − p) ÷ n), turn it into points, then double it.

0.4 × 0.6 = 0.24; ÷ 96 = 0.0025; √0.0025 = 0.05, which is 5 points; twice that: ± 10 points.
SE = √(0.4 × 0.6 ÷ 96) = √0.0025 = 0.05, or 5 points. The error bar is 2 standard errors either side: ± 10 points.

Pick the best of each stack

Now do what a search does. In each group (no conditions, one, two, three, four) keep the version with the highest win rate on 2015 to 2021, after costs. More conditions give more versions to choose from, each with fewer trades and a wider error bar, so the luckiest one sits further up.

The plain rule won 31.0 in 100. Guess the best four-condition version's win rate, averaged over the 1,000 simulated markets.

The best version of each group: win rate on 2015–2021, after costs (average of 1,000 simulated markets)

One bar per group, by the number of conditions. Dashed: the plain rule.

Best of 81, four conditions?

The best's win rate climbed with every condition: 31.0, 36.9, 39.7, 41.5 and 42.2 in 100. On this lesson's market the best of the 81 four-condition versions won 38 of its 86 trades: 44.2 in 100.

Does the best stay best?

2022 to 2024 were set aside before any version was run: years held out, to be used once (the Held-out test lesson). Each group's best now runs on them.

A second check: take the best of all 256 on 2015–2021 and count how often it is still best on 2022–2024. A blind draw, one version taken at random, would be best there in about 4 of 1,000 markets (1,000 ÷ 256 = 3.9). But versions with few trades swing further, so they land on top more often. A fairer comparison is the version that trades least, chosen in advance without looking at any result: it was best on 2022–2024 in 42 of 1,000.

The best of each group, 2015–2021 and 2022–2024, after costs (average of 1,000 simulated markets)

Orange: the years it was picked on. Grey: the held-out years. Dashed: the plain rule.

On 2022–2024, the four-condition best's win rate will be

Lower. On 2022–2024, after costs, the bests won 31.1, 36.6, 36.8, 36.7 and 36.5 in 100. Everything the second, third and fourth conditions added was gone; the first condition's gain stayed (the next card says why).

The best of all 256 stayed best in 15 of 1,000 simulated markets: more than a blind draw's 4, mostly because it traded little (132 trades on 2015–2021 against the plain rule's 1,817) and nearly always used the 0.10% gap (878 of 1,000), and fewer than the least-trading version's 42. It is not skill, and it says nothing about a real market.

What held up, and why

The single condition with the best win rate after costs was a gap of at least 0.10% in 903 of the 1,000 simulated markets. A gap that big forms only when the price moves fast. Across the 1,000 simulated markets, on 2015 to 2021, its trades moved further than the plain rule's (0.81% against 0.55% on average, before costs) and fewer of them hit the stop (37.4 in 100 against 46.6), so the same 0.2% of costs took a smaller share and more trades ended ahead.

The other conditions don't pick bigger days, and alone they left the win rate after costs at 30.8 to 31.2 in 100. A higher win rate is not a gain: it ignores how big the wins and losses are. On 2015 to 2021, after costs, the plain rule's profit trailed just holding (buying once and never selling, which pays one 0.1% buy) in all 1,000 simulated markets, and the 0.10% gap version's in 997. So the fast-day effect lifted the win rate, not the profit.

Why did the 0.10% gap version's higher win rate repeat on the held-out years?

It keeps fast-moving days. That changes how trades end in any year, which is why it repeated, without saying anything about direction.
These markets were built so that nothing tells which way the next move goes. It keeps fast-moving days, whose trades move further and hit the stop less, in any year.
Luck doesn't repeat on years set aside; this did, because it changes which days are traded: bigger moves, fewer stops.

How many findings would chance give?

Call a version a finding if its win rate on 2015–2021, after costs, is more than 2 standard errors above the plain rule's. With nothing in it, one version does that by chance about 2.3 times in 100: on a bell curve 95.4 in 100 land within 2, so (100 − 95.4) ÷ 2 = 2.3 land above.

For the preciseLeave out the gap condition, and 63 stacked versions remain that barely change the plain rule's win rate. If their luck were separate, chance would give 63 × 2.3 ÷ 100 = 1.4 findings a market. Counted in this simulation: 0.48 a market, fewer because they share many of their trades with the plain rule they are compared with. Of those findings, only 44 in 100 also beat the plain rule's win rate on 2022–2024. Counting the versions with the gap condition too, there were 43 findings a market: the fast-day effect, not a sign of direction.

A search tries 300 versions with nothing in them, each judged alone. About how many findings would chance give?

Hint: each one clears the bar by chance 2.3 times in 100.

300 × 2.3 ÷ 100 = 6.9, about 7 findings with nothing in them.
Each of the 300 clears the bar by chance 2.3 times in 100: 300 × 2.3 ÷ 100 = 6.9.

What this means for your test

  1. Count the stack's versions before you test it.

    Each condition is off or one of its settings, so multiply (1 + settings) across the conditions: 4 × 4 × 4 × 4 = 256 here.

Practice 1 of 3

A filter that held up

The situationAn invented post: "Adding a big-candle filter lifted my win rate from 40% to 46%, and it held on two years I set aside. So the filter knows where the price goes."

What would you check first?

Worth asking, but the gain repeated. The first question is what repeated: a filter that keeps big-move days raises the win rate in any year, with no sign of direction.
In this lesson's simulated markets the 0.10% gap lifted the win rate on held-out years too, because its trades moved further and hit the stop less. That repeats without any sign of direction.
A win rate above or below 50% says little on its own: it depends on where the stop sits and on costs. The question is why it rose.
Practice 2 of 3

Seventy percent of thirty

The situationA friend's five-condition stack won 70% of its 30 trades.

How wide is its error bar either side, in points?

Hint: SE = √(p × (1 − p) ÷ n), in points, then double it.

0.7 × 0.3 = 0.21; ÷ 30 = 0.007; √0.007 = 0.0837, 8.4 points; twice that: ± 16.7 points, from about 53% to 87%.
SE = √(0.7 × 0.3 ÷ 30) = √0.007 = 0.0837, or 8.4 points; the error bar is twice that: ± 16.7 points.
Practice 3 of 3

Count the stack

The situationA friend stacks three conditions on a rule: one with 4 settings, one with 2, one with 3. Each can also be off.

How many versions is that, the plain rule included?

Hint: each condition has its settings plus "off".

(4 + 1) × (2 + 1) × (3 + 1) = 5 × 3 × 4 = 60.
Add "off" to each condition's settings, then multiply: 5 × 3 × 4 = 60.
✓

Lesson done

A confluence rule takes a trade only when several conditions agree, and every condition and setting is another version: four conditions, each off or one of three settings, made 256. In these simulated markets, built so that past prices say nothing about which way the next move goes, each added condition cut the trades (260 a year for the plain rule, 21 for the four-condition baseline stack) and widened the error bar, and the best win rate after costs on 2015 to 2021 climbed with every condition (31.0 to 42.2 in 100, averaged over 1,000 markets). On the held-out years 2022 to 2024 everything stacking added beyond the first condition was gone; the gain that stayed came from keeping fast-moving days, not from direction. The best of 256 stayed best in 15 of 1,000 (a blind draw: about 4; the least-trading version chosen in advance: 42), mostly because it traded little. The counts cannot show whether confluence works in a real market.

Key ideas

Confluence
several conditions that must all agree before a trade is taken; a stacked rule keeps a trade only when every condition on its list agrees
Version
the same idea with different settings; every condition and every setting of it makes more, and they multiply
Standard error, error bar
how far chance typically moves a measured win rate; the bar is the win rate ± 2 standard errors and widens as trades get fewer
Finding
a version whose win rate beats the plain rule's by more than 2 standard errors; one version with nothing in it does so by chance about 2.3 times in 100

Formulas

SE = √(p × (1 − p) ÷ n), error bar = p ± 2 × SE, for n trades with win rate p (as a fraction), when trades don't affect one another, the true win rate stays the same and it is measured once, not picked as the best of many

versions = (1 + s1) × (1 + s2) × …, when each condition is off or one of its s settings

Lesson notes

A confluence rule takes a trade only when several conditions agree with it. Each condition, and each setting of it, is another version of the rule: in this lesson four conditions, each off or one of three settings, made 256 versions. Its simulated markets were built so that past prices say nothing about which way the next move goes, so its counts show what stacked rules do when there is nothing to find. In them, every added condition cut the trades and widened the error bar of the win rate; the best win rate after costs climbed with every condition on the years it was picked from, and on years set aside everything stacking added beyond the first condition was gone. The counts cannot show whether confluence works in any real market; that needs its own test.

The plain rule and four conditions

The plain rule is the Opening-range breakout lesson's baseline version. The opening range is the highest and lowest price from 09:30 to 10:00; after 10:00 the rule buys if the price reaches the range's high first and sells short (sells first, buys back later) if it reaches the low first; a stop (a set price that ends a losing trade) sits at the other side of the range; otherwise the trade ends at 16:00. Each buy and each sale costs 0.1% of the price, and a trade is a win only if it ends ahead after costs; the win rate is the share of trades that win. On 2 Jan 2017 it bought at 106.42 and ended at 106.43: +0.01% before costs, −0.19% after, a loss. Across 1,000 simulated markets it traded on 260 days a year from 2015 to 2021 and won 31.0 in 100 of its trades after costs.

Four conditions can be stacked on it. Two are read from earlier days' daily bars (one bar a day: its open, high, low and close): the daily trend (by yesterday's colour, up if it closed above its own open, yesterday's close against its 20-day average, or the 10-day average against the 30-day one) and market structure (a trend set by closes beyond the latest swing high or low, a swing being a day above or below the 2, 5 or 10 days either side of it). Two are read inside the day: a session window (the entry starts by 10:30, 11:00 or 12:00, New York time) and a fair value gap in the trade's direction finished before the entry (three bars whose first and third don't overlap; any size, at least 0.05% or at least 0.10% of the price). On 2 Jan 2017 yesterday's bar closed below its open, so the colour reading dropped the buy, while market structure (width 5) kept it; the 10:15 entry passed every window, and a 0.10% up gap had finished before it.

Versions, trades and error bars

Each condition has four choices (off or one of three settings), so there are 4 × 4 × 4 × 4 = 256 versions: 1 with no condition, 12 with one, 54 with two, 108 with three and 81 with four. The baseline stack adds the conditions in this order: colour, the 10:00–11:00 window, structure width 5, a gap of at least 0.05%. Across the 1,000 simulated markets on 2015 to 2021, after costs, it went from 260 trades a year to 21, and the range that held the middle 95 of its 1,000 win rates widened from 28.7–33.5 (plain rule) to 27.0–42.6 (four conditions).

The best of each stack, and the held-out years

Keeping the version with the best win rate in each group (no conditions, one, two, three, four) on 2015 to 2021, after costs, gave 31.0, 36.9, 39.7, 41.5, 42.2 in 100 on average over the 1,000 simulated markets. On the held-out years 2022 to 2024 (set aside before any run, used once) the same versions won, after costs, 31.1, 36.6, 36.8, 36.7, 36.5: everything the second, third and fourth conditions added was gone. The best of all 256 stayed best on the held-out years in 15 of 1,000 markets, against about 4 for a blind draw, one version taken at random (1,000 ÷ 256 = 3.9), and 42 for the version that trades least, chosen in advance. It beat a blind draw mostly because it traded little and nearly always used the 0.10% gap; it is not skill.

What held up, and findings from chance

The gain that stayed came from one condition: the single condition with the best win rate after costs was a gap of at least 0.10% in 903 of 1,000 simulated markets. Its trades moved further than the plain rule's (0.81 against 0.55% on average, before costs) and fewer hit the stop (37.4 against 46.6 in 100), so costs took a smaller share. That higher win rate repeats in any year without saying anything about direction, and a higher win rate is not a gain in money: on 2015 to 2021, after costs, the plain rule trailed just holding (buying once, paying one 0.1% buy) in all 1,000 simulated markets and the 0.10% gap version in 997.

A finding here is a version whose win rate on 2015 to 2021 is more than 2 standard errors above the plain rule's; one version with nothing in it does that by chance about 2.3 times in 100. Without the gap condition, 63 stacked versions would give about 63 × 2.3 ÷ 100 = 1.4 findings a market if their luck were separate; the simulation counted 0.48, fewer because they share many of their trades with the plain rule they are compared with, and only 44 in 100 of those findings also beat the plain rule's win rate on the held-out years. Counting the versions with the gap condition too, there were 43 a market: the fast-day effect, not direction.

Formula: the error bar of a win rate

A win rate is an average of wins (1) and losses (0). Its standard error is how far chance typically moves it from the rate the rule would show over endless trades; on a bell curve (the hump-shaped spread of many random results) about 95 in 100 results land within 2 standard errors, so the error bar is the win rate ± 2 standard errors.

SE = √(p × (1 − p) ÷ n)  ·  error bar = p ± 2 × SE
p
the win rate as a fraction
n
the number of trades
SE
the standard error, as a fraction (× 100 for points)
Worked example: the four-condition baseline stack

p = 0.35, n = 147: 0.35 × 0.65 = 0.2275; ÷ 147 = 0.00155; √ = 0.039, so SE = 3.9 points and the bar is ± 7.9. Across the 1,000 simulated markets its win rates had a standard deviation (typical distance from their average) of 3.9 points and the middle 95 ran 7.8 either side. Twelve times fewer trades than the plain rule's 1,817 made the bar about √12.4 = 3.5 times as wide.

Holds whenBreaks when

A search keeps the best of many versions: the one it keeps is the luckiest, and its bar sits too high.

One more worked example

Made-up round numbers

A rule wins 50% of 400 trades: SE = √(0.5 × 0.5 ÷ 400) = √0.000625 = 0.025, so the bar is ± 5 points, 45% to 55%. Stack conditions until 25 trades are left, 16 times fewer: SE = √(0.25 ÷ 25) = 0.1, a bar of ± 20 points, 30% to 70%, four times as wide (√16 = 4). Try 81 such versions and keep the best, and its win rate can easily sit at or above the top of that wider bar with nothing in it.

Common mistakes

Check yourself

  1. A stack has two conditions, one with 3 settings and one with 5, each of which can be off. How many versions, the plain rule included?
    Answer

    (3 + 1) × (5 + 1) = 24.

  2. A version won 45% of 100 trades. What is its error bar?
    Answer

    SE = √(0.45 × 0.55 ÷ 100) = √0.002475 = 0.0497, about 5 points; the bar is about ± 9.9 points, roughly 35% to 55%.

  3. In the lesson's simulation, the best four-condition version won 42.2 in 100 on 2015 to 2021. Does that show the four conditions find good trades?
    Answer

    No. It was the best of 81, each with few trades and a wide error bar; on the held-out years the same versions won 36.5 in 100, no more than the best single condition, and the part that stayed came from keeping fast-moving days, not direction. These are simulated markets built with nothing to find; a real market needs its own test.

  4. A search tries 200 versions with nothing in them, each judged alone. About how many findings beyond 2 standard errors would chance give?
    Answer

    200 × 2.3 ÷ 100 = 4.6.

Try it yourself

The rules, written before the code. The plain rule: the opening range is 09:30–10:00 (six five-minute bars); from 10:00 a buy stop at the range's high and a sell-short stop at its low; the first bar to reach either edge fills there (no trade if that bar reaches both); a stop at the other side, watched from the next bar; out at 16:00. Conditions, each off or one of three settings, read at the entry: daily trend from yesterday's bar (colour, close against the 20-day average, 10-day against 30-day average); market structure trend after yesterday's close (width 2, 5 or 10; swings from the wicks, breaks by a close); entry bar starting by 10:30, 11:00 or 12:00; a wick gap in the trade's direction with bar 3 before the entry bar (any size, 0.05%, 0.10%). A version keeps the plain rule's trade only if all its conditions agree. 0.1% of the price per buy and per sell; a win is a trade ahead after costs. Choosing years 2015–2021, held-out years 2022–2024.

Run the script. Every number in this lesson comes from one Python script (below). It imports simmarket.py, the course's simulated market, which must sit in the same folder. Add a fifth condition and watch the count of versions, the trades a year and the best win rate move.

By hand. In a spreadsheet with one row per trade (1 for a win, 0 for a loss in column B), the win rate is =AVERAGE(B:B) and its standard error =SQRT(AVERAGE(B:B)*(1-AVERAGE(B:B))/COUNT(B:B)).

Written by QuantWright from the rules of the earlier lessons of this course. No code from any indicator script or charting platform.

The code behind every number (Python, imports SimMarket, seed 20261109)
Loading…
For the preciseThe lesson's market: SimMarket Market 1, seed 20261109, effect=False (no planted pattern), five-minute bars built with bridge="normal" (no pull-back within the day), the same bars as the Opening-range breakout lesson (the plain rule's trade on every day is checked against that lesson's). The 1,000 simulated markets: the same generator and setting with seeds 2026241501 to 2026242500. Choosing years: from the close of 5 Jan 2015 to 31 Dec 2021 (6.99 calendar years); held-out: to 31 Dec 2024 (3.00 years). A trade's return before costs is exit ÷ entry − 1 for a buy and 1 − exit ÷ entry for a short sale; after costs it is multiplied by 0.999². The lesson's market: the plain rule traded 1,818 times on 2015–2021 and won 577 after costs; holding grew 4.36% a year after its one cost. Before costs, the plain rule won 40.2 in 100 across the 1,000 markets, and the best of each group 40.2, 44.8, 47.5, 49.3 and 49.7 on 2015–2021 against 40.4, 44.0, 44.2, 44.0 and 43.5 on 2022–2024: the same pattern. Of the 43 findings a market after costs, 82 in 100 also beat the plain rule's held-out win rate. The best of 256 had four conditions in 631 of the 1,000 markets and three in 280; its average held-out place was 93.9; no group's best ever had no held-out trades. Ties for first place on the held-out years came in 52 markets (the blind draw with ties: 4.2). The least-trading version always had four conditions and averaged 66 trades on 2015–2021. On 2015–2021, after costs, the best of 256 beat holding in 83 of the 1,000 markets; on average 4.55 of the 256 did, and at least one in 106. Two of the 1,000 markets closed below $30 at some point (the lowest close, $26.82).

Honest notes

Where this comes from