Testing Popular Ideas · Lesson 7
Previous day high and low
Two levels from yesterday, two opposite ways to read them, and the 16 versions inside one idea.
Know the basics? Read the lesson notesYesterday's high and low
Each day in this market is one session, the hours it is open: 09:30 to 16:00. The prices come as five-minute bars: lesson A12's candles, each holding the open, high, low and close of five minutes of trading, 78 a day. Yesterday's high is the highest price of any of yesterday's bars; yesterday's low is the lowest. Traders draw both as lines across today.
The prices are simulated: made up by a computer, not a real market. Mark yesterday's high and low, then guess: will today's price get to yesterday's low before 16:00?
Yesterday and today, 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). Dashed: yesterday's high and low.
It got there in the very first bar, at 09:30: that bar's low was 107.45, exactly yesterday's low. Later in the day the price fell to 106.86.
Which hours are yesterday?
Here that is easy: one session a day, nothing traded overnight. Many markets trade around the clock, or add a night session. Then "yesterday" needs a rule: when does a day start? Below are made-up hourly prices of a market that trades day and night, seen on Wednesday morning. Try each rule.
One market, three ways to start a day (made up)
Line: the price each hour. Shaded: the hours the rule calls yesterday. Dot: their highest price.
Three rules, three highs: 103.6, 104.0 and 102.4. A test has to say which one it uses.
This lesson's simulated market has one session a day, so yesterday means the previous session.
Touch or close through
A level is one price; a bar has four. So "the price got to yesterday's low" needs an exact reading. A bar touches yesterday's low when its low is at or below it. A bar closes through it when its close is below it. At yesterday's high, turn both round: a high at or above it, a close above it.
A bar that touches and closes back on the near side has a wick through: only its wick, the thin line down to its low, went past. Step through this morning's bars.
Today's first bars, against yesterday's low (simulated)
Dashed: yesterday's low, 107.45. Bars are named by the minute they start.
The 09:30 bar touched (its low, 107.45, equals the level) and closed at 107.50, back above: a wick through. The first close through came in the 09:45 bar, at 107.43. A rule acting on a touch acts at least 15 minutes earlier.
How often is yesterday's high touched?
Traders treat yesterday's high and low as levels prices are drawn to. Before reading anything into a touch, count how often one happens anyway: its base rate. Guess: on how many days in 100 does the price touch yesterday's high?
Days that touched yesterday's high, by where yesterday closed (simulated)
Pooled over 1,000 simulated markets: all their days counted together. Left: yesterday closed near its low; right: near its high.
On this simulated market, 1,332 of 2,606 days: about half. On 1,000 more simulated markets built the same way, 51.3 days in 100 touched yesterday's high.
Why so often? Today starts near yesterday's close, which sits somewhere between yesterday's high and low, and today's prices typically spread about as far as yesterday's did. The nearer yesterday closed to its high, the shorter the way up: from 21 days in 100 when it closed in the bottom fifth of its range to 80 in the top fifth.
For the precise
Every day from the second to the last of ten years: 2,606 a market. Across the 1,000 simulated markets the share touching yesterday's high ran from 48.3 to 54.5 in 100; yesterday's low was touched on 48.0 days in 100, at least one of the two on 87.4, and both on 12.0. The bars, pooled: 120,954 of 563,518 days (21.5 in 100), 177,179 of 485,230 (36.5), 230,334 of 451,671 (51.0), 328,127 of 502,359 (65.3) and 481,380 of 603,222 (79.8). A day that opens above yesterday's high touches it on its first bar: 15.1 days in 100.Touched, then what?
So a touch of yesterday's high is common. Is it a sign the price goes on up? Of the days that touched yesterday's high, how many ended the day above it (the 16:00 close)?
A common event says nothing by itself. What a rule does after it, after costs and against just holding, is what a test reads.
One level, opposite rules
"Trade yesterday's high" is not a rule yet. Two common readings are opposite:
- Breakout: a price past the level keeps going. At the high it buys; at the low it sells short.
- Rejection: a price that went past and came back turns. At the high it sells short; at the low it buys.
Selling short means selling first and buying back later, so the trade gains when the price falls.
On a touch, a breakout waits with a stop order at the level, an order that fires once the price reaches it (see Orders): it fills at the level, or at the open if the day opened past it. A rejection enters at the close of the first bar back on the near side. On a close through, both first wait for a bar to close past the level. Every rule is out by 16:00. Show both readings at both levels.
Opposite readings on one day at each level (simulated)
Dashed: the level. Orange: from the entry to 16:00.
Same level, same day, opposite trades. The day shown for the high, 2017-01-03, is a different day from the one shown for the low (2017-01-10). It opened at 107.19, above yesterday's high of 106.93, so the price never traded at the level, and the breakout on a touch bought at the open, 107.19.
How many versions?
One more choice: when to get out. At 16:00, or with the level exit: at the close of the first bar on the wrong side of the level for the trade, and at 16:00 if none comes. The wrong side is where the trade's reading has failed: for a breakout, back on the near side of the level; for a rejection, past it again.
Each different set of choices is a version: the same idea with different settings (lesson E1, How we test an idea). Level, reading, entry, exit: how many versions?
One version against just holding
Start with one exact rule: breakout at yesterday's high, on a touch, out at 16:00. Call it the baseline version: the one this lesson starts from and sets the others against, not anyone's published rule.
It runs from 2015 to 2021 against just holding: buying on the first day and never selling (lesson E1). Each buy and each sale costs 0.1% of the price (lesson A16, Costs); holding pays that once. Results are in % a year. 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, on a log scale: equal steps up the side are equal percentage gains. Orange: the baseline version. Dotted: holding.
It lost 23.1% a year after costs; before costs it made 0.8% a year. It traded on about 135 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 −23.1 − 4.4 = −27.5 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; the low outlines near −25 to −19 are the few markets that trailed holding that far even before costs, drawn over the grey bars there.
Before costs it beat holding in 116 of the 1,000 simulated markets; after costs, in none.
For the precise
Its lead averaged −7.1 points a year before costs and −30.9 after, across the 1,000 simulated markets.These markets were built so that past prices say nothing about which way the next move goes, from one day to the next or within a day; they only rise a little on average. So the counts show what these rules produce when there is nothing to find. They cannot show whether these levels work in any real market.
All 16 versions
Here are all 16 versions on the same simulated market and years, 2015 to 2021. Call those the choosing years: a version will be chosen on them. Show them, then turn the costs on.
16 versions: each one's lead over holding, 2015–2021 (simulated)
One bar per version, grouped by level and reading; in each group, left to right: touch then 16:00, touch then level exit, close through then 16:00, close through then level exit. Above the line: beat holding. Black: the baseline version. Solid orange: the best.
On this market none of the 16 beat holding, before or after costs. The best after costs was the rejection at the low on a close through, out at 16:00: −21.0 points a year. The baseline version came 14th of 16: its place, counting from the largest lead.
On the 1,000 simulated markets, after costs, at least one of the 16 beat holding in only 2.
For the precise
Before costs, at least one of the 16 beat holding in 290 of the 1,000 simulated markets.Does the best stay best?
Before any version was run, 2022 to 2024 were set aside: years held out, to be used once (lesson B10, The held-out test).
On each of the 1,000 simulated markets we took the best of the 16 on the choosing years, after costs, the pick, and ran it once on the held-out years. A blind draw, a version picked at random, would be best there in about 63 of 1,000 (1,000 ÷ 16 = 62.5). Guess how often the pick stayed best.
The pick's held-out place on 1,000 simulated markets, after costs
One bar per place, 1st on the left. Dashed: a blind draw.
The pick stayed best in 264 of the 1,000 simulated markets, against a blind draw's 63. Yet it beat holding after costs on the held-out years in only 10.
Why 264? The pick was usually a rejection version that waits for a close through. Those trade on about 86.5 and 91.3 days a year (at the low and the high), against 111.3 for all 16 on average, so they pay the least in costs. It is not skill, and it says nothing about a real market.
For the precise
The pick was a rejection version entering on a close through in 918 of the 1,000 simulated markets. With costs left out, the best before costs still stayed best, before costs, in 138 of the 1,000 simulated markets: in 799 it was a version that buys, and these markets drift up.Why touching is common: the reflection principle
Picture every day that touches a level. From that moment, if prices have no pattern in which way they move, the rest of the day is as likely to end above the level as below, like a fair coin (lesson A4). Every day that ends beyond the level touched it on the way. So a touch is about twice as common as ending beyond: the reflection principle (mirror the path after the touch, and an end above becomes an end below).
- P(touch)
- the chance a price touches the level at some point in a stretch of time, such as a day
- P(end beyond)
- the chance it ends that stretch beyond the level (above a high, below a low): count it on past days, as below, or read it off the bell curve from the level's distance in typical day's moves (see The bell curve)
- ≈
- about: exact only for prices with no pattern in which way they move, watched at every moment
The day ended above yesterday's high on 701 of 2,606 days: 26.9 in 100. The days that touched it: 1,332, which is 51.1 in 100. Twice 26.9 is 53.8, a little above the real 51.1, because gap days (days that open beyond the level) end beyond the level without the halving. And 701 of the 1,332 touches ended above: 52.6 in 100, about half.
- from the level, an up move is as likely as a down move;
- the price can't jump past the level without trading at it;
- the drift, the small average rise, is small over a day next to the day's moves.
A gap jumps past the level (a gap: the day opens beyond the level, so the price never trades at it; see Orders), prices drift strongly, or there is a pattern. In the 1,000 simulated markets a day opened above yesterday's high on 15.1 days in 100; those days count as touches because the high is above the level, though no trade happened at it, so 53.4 in 100 touches of the high ended above it (51.0 of the low below it), a little over half.
A market with no pattern touches a level on 40 days in 100. About how many of those 100 days end beyond it?
What this means for your test
- Write the exact rule before you run it.
Which hours make a day; touch or close through; which reading; the price each entry gets; the exit; the costs.
- Count the base rate, then compare with just holding after costs.
In these simulated markets yesterday's high was touched on about half of all days, yet after costs the baseline version trailed holding in all 1,000.
- Count the versions, the opposite reading too, then hold out years.
16 here. After costs the best of 16 stayed best on held-out years in 264 of 1,000 simulated markets, against about 63 for a blind draw, because it traded least: not a sign the level works.
A post's claim
What does the 6 in 10 leave out?
A bigger search
How many versions is that?
Hint: multiply the number of choices for each setting.
Two charts, one market
What follows?
Lesson done
Yesterday's high and low are the previous session's highest and lowest prices; which hours count as a day is part of the rule. In these simulated markets the price touched yesterday's high on about half of all days, and about half the touches ended the day beyond it. These 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: after costs the baseline version trailed just holding in all 1,000 simulated markets, and the best of 16 stayed best on held-out years in 264 (a blind draw: about 63) because it traded least, not because a level worked. They cannot show whether these levels work in any real market.
Key ideas
- Yesterday's high, low
- the highest and lowest prices of the previous session; in a market that trades around the clock, which hours count as a day is a choice
- Touch, close through
- a bar whose high reaches a level (for a low: whose low reaches it); a bar whose close goes past it. A touch that closes back is a wick through
- Base rate
- how often something happens anyway, before any rule acts on it
- Breakout, rejection
- opposite readings of a level: the move goes on, or it turns back. Each is a rule to test, not a finding
- Selling short
- selling first and buying back later; the trade gains when the price falls
- Version
- the same idea with different settings; count every one
Formulas
P(touch) ≈ 2 × P(end beyond), for prices with no pattern in which way they move, watched at every moment (the reflection principle)