Demonstration 1 of 4
What a candle keeps that a closing price throws away
How much of a trading session does the closing price alone tell you?
Each candle draws a thin line from the low to the high and a body from the opening to the close. The closing line keeps one number per session, so a session that swung widely and ended where it began looks the same as a session in which nothing happened.
Scroll sideways for the whole equation
H and L are the highest and lowest prices of session t; the opening and closing prices are the first and last trades. A filled candle closed below its opening, a hollow candle above it.
Predict first. Session 3 closed only 0.07 below its opening. Will its range be larger or smaller than 1?
Choose an example
Scroll sideways for the whole figure
Constructed data: the seeded synthetic prices of the chapter notebook's first figure, not historical Dojima records.
Calculated values
- Open
- 98.73
- High
- 99.25
- Low
- 97.93
- Close
- 98.66
- Range, high minus low
- 1.32
- Change, close minus open
- -0.07
Session 3: range = 99.25 - 97.93 = 1.32, while the close moved 98.66 - 98.73 = -0.07. The candle shows all four prices. A range 18.9 times the size of the net change is a session in which buyers and sellers argued far more than the close admits.
Worked steps
- Range: 99.25 - 97.93 = 1.32.
- Change: 98.66 - 98.73 = -0.07.
- The closing price alone keeps only the second line.
Use the idea
Before summarising any price series by its closes, look at the high and low as well: a wide range with a small net change is disagreement the close does not record.
Where the conclusion applies
Prices are a seeded constructed series (seed 20260919), not reconstructed Dojima rice prices. A wide range is a clue about disagreement, not proof of it: a single large order can also widen it.
Check your understanding: A session opens at 50.00, trades as high as 53.00 and as low as 48.50, and closes at 50.40. What are its range and its net change?
Chapter 1 source: section "What the Market Knows".
Demonstration 2 of 4
News reaches the price one session at a time
If a price absorbs only part of the news each session, how long does it stay wrong?
The rule moves the price a fixed share of the way toward the valuation each session, so the gap shrinks geometrically: 10, then 10 x (1 - lambda), then 10 x (1 - lambda)^2. Noise adds a random step on top.
Scroll sideways for the whole equation
p is the price in session t, v the valuation the information supports (100, then 110 from session 20), lambda the share of the remaining gap closed each session, and epsilon the trading noise, with standard deviation 0 or 0.35.
Predict first. At speed 0.22 with no noise, will the price be within 3 of the new valuation five sessions after the news?
Choose an example
Scroll sideways for the whole figure
Constructed data: the chapter notebook's toy information shock (valuation 100 to 110, speed 0.22, noise 0.35), with the speed and noise varied.
Calculated values
- Adjustment speed
- 0.22
- Price at session 24
- 107.36
- Gap left at session 24
- 2.64
- Gap with no trading noise
- 2.89
- First session within 1 of 110
- 31
After the news the price closes 22 percent of the remaining gap each session. Five sessions later (sessions 20 to 24) the noise-free gap is 10 x (1 - 0.22)^5 = 2.89. Trading noise moves the actual gap (2.64) away from the noise-free 2.89. Until the gap closes, the price is a forecast that has heard the news but not yet finished believing it.
Worked steps
- Gap when the news arrives: 110 - 100 = 10.
- Each session keeps 1 - 0.22 = 0.78 of the gap.
- After five sessions: 10 x 0.78^5 = 2.89 with no noise.
- Simulated price at session 24: 107.36, gap 110 - 107.36 = 2.64.
Use the idea
When a price or a prediction market contract jumps after news and keeps drifting the same way, read the drift as the market still absorbing information, not as a new forecast each day.
Where the conclusion applies
The adjustment rule and its speed are assumed for teaching, not estimated from any market; the chapter's point is that prices aggregate information, not that they do so at a known rate. The noise uses the notebook's seeded draws (seed 20260919). Noise can carry the price past the valuation by chance, but a market where everyone hears the same story can overshoot for long stretches, which this rule cannot produce.
Check your understanding: With speed 0.5 and no noise, what gap remains five sessions after a 10 point jump in the valuation?
Chapter 1 source: section "Prediction Markets: The Mechanism Generalized".
Demonstration 3 of 4
A pattern has to beat persistence on data it did not choose
If a momentum rule beats 'tomorrow equals today' on one price series, have you found a pattern?
Each dot is one walk: its persistence error across, its momentum error up. Dots below the dashed line are walks where momentum won. Highlighting one walk can pick a dot below the line; the whole cloud sits above it.
Scroll sideways for the whole equation
y is the value at step t and y-hat its forecast. Persistence forecasts the last value; momentum adds m times the last change. MAE is the mean absolute error over the 30 held-out steps of each walk (steps 71 to 100).
Predict first. Walk 2 favours momentum. Over all 400 walks, will momentum still beat persistence?
Choose an example
Scroll sideways for the whole figure
Constructed data: the chapter notebook's 400 seeded random walks of 100 steps, last 30 held out; m = 0.5 is the notebook's rule.
Calculated values
- Walks scored
- 1
- Persistence MAE
- 1.151
- Momentum MAE
- 1.123
- Momentum minus persistence
- -0.028
- Walks where momentum wins
- 1 of 1
Over walk 2 alone, momentum MAE minus persistence MAE is 1.123 - 1.151 = -0.028, so momentum looks better here. Across all 400 walks momentum wins in 50 of 400. Every walk is a pure random walk, so any momentum win is chance: one walk can flatter a rule that the full set of walks rejects.
Worked steps
- Mean persistence MAE over walk 2 alone: 1.151.
- Mean momentum MAE (m = 0.50): 1.123.
- Difference: 1.123 - 1.151 = -0.028.
- Momentum wins in 1 of 1 highlighted walks and 50 of 400 overall.
Use the idea
Before trusting a pattern found in one price history, score it against persistence on many series or periods it was not chosen from, with the rule written down first.
Where the conclusion applies
The walks are pure random walks (seed 20260919), so the honest answer is that no rule should beat persistence. Real prices can have structure; the test still needs a benchmark and data the rule did not select.
Check your understanding: On one walk persistence scores 0.769 and momentum 0.895. On another persistence scores 1.151 and momentum 1.123. Which rule wins each, and what does the pair tell you?
Chapter 1 source: section "A Sidebar on Patterns in Numbers".
Demonstration 4 of 4
First digits that remember where numbers came from
Can the leading digits of a set of numbers tell you anything about how the numbers were made?
Each bar is the share of values starting with a digit; the curve is Benford's law. Numbers that grow by multiplying across several powers of ten pile up on small leading digits; numbers someone invents spread evenly; numbers confined near one level, like these prices around 100, follow neither.
Scroll sideways for the whole equation
d is the leading digit, 1 to 9, and P(d) the share of values Benford's law expects to start with it: 30.1 percent for 1, 4.6 percent for 9. The chi-square statistic compares observed and expected counts over all nine digits.
Predict first. Will invented figures with evenly spread first digits have more or fewer leading 1s than Benford expects?
Choose an example
Scroll sideways for the whole figure
Constructed data: the companion's seeded example closing prices for this chapter, plus two sets generated for this demonstration; the check is the companion's own Benford test.
Calculated values
- Values
- 140
- Leading 1, observed
- 41 (29.3 percent)
- Leading 1, Benford
- 42.1 (30.1 percent)
- Chi-square
- 4.4
- p-value
- 0.820
Benford expects 140 x 0.3010 = 42.1 leading 1s among 140 amounts spanning several powers of ten; there are 41. Across all nine digits the chi-square is 4.4 (p 0.820), so this set is consistent with Benford at this sample size. Values spread across several powers of ten are where Benford's pattern appears.
Worked steps
- Benford share for 1: log10(1 + 1/1) = log10(2) = 0.3010.
- Expected leading 1s: 140 x 0.3010 = 42.1.
- Observed leading 1s: 41.
- All nine digits together: chi-square 4.4, p 0.820.
Use the idea
Run a leading-digit check on a set of reported figures that span several orders of magnitude, and treat an unexplained deviation as a reason to look closer, never as proof of fabrication.
Where the conclusion applies
Benford's law needs values spread over several powers of ten. Many honest datasets break it for structural reasons (prices near one level, assigned numbers, capped amounts), and with 50 values the test has little power. The wide-range and invented sets are generated here with seed 20261019.
Common wrong turn: A deviation from Benford proves fraud
Check your understanding: Out of 1,000 expense amounts spanning several powers of ten, how many would Benford expect to start with 9?
Chapter 1 source: section "A Sidebar on Patterns in Numbers".