▲ Work in progress. This site is built and researched in the open: pages, numbers and findings may change or be wrong, and the record has gaps. Not advice. More

The Lab

Ideas traders use, put to the record

← the Lab · models explained · write-up

#16 Models for reading a market, and what they showed on real prices

Past prices; no real orders were placed. Each model is explained first. Then comes what happened when we tested it on Bitcoin, Ether and Solana, against fake markets or random choices.
Last checked: 16 October 2026.

How we test, every time:

1. Markov models: states and how they follow each other

A Markov model (after the mathematician Andrey Markov, 1906) describes something that moves between states. The chance of what comes next depends only on the state now, not on how it got there.

Example: the weather. Each day is sunny or rainy:

today → tomorrowsunnyrainy
sunny80%20%
rainy40%60%

This table is the transition matrix. It tells you three things:

(All three are worked through in The maths, step by step, near the end.)

In a market the states might be "trending up", "trending down" and "ranging", given by a rule such as an indicator's reading.

What we found. We built a Markov model on a common trend label (the ADX indicator, J. Welles Wilder's) for BTC, ETH and SOL.

The limit. Markets aren't truly memoryless, and the odds themselves change over time. A Markov model describes; it doesn't predict prices.

2. The hidden Markov model: calm and wild

A hidden Markov model (Baum and Petrie, 1966) assumes there is a true state you can't see, such as "calm" or "wild". It shows itself only through what you can see: the price moves. The model learns the states from the data itself. Each hour it gives a probability, such as "82% calm, 18% wild", not a hard label.

regular Markovhidden Markov
the statesgiven by a rule we chooselearned from the data
it needsa label at every steponly the price moves
noiseflickers at the rule's thresholdssmoothed into probabilities
main riska bad rule makes a bad modelits states may not mean what you hope

How it decides each hour (with the numbers from one fit on hourly moves):

  1. Carry the last hour's belief forward. A wild hour stays wild 83.6% of the time. A calm hour turns wild 5.7% of the time.
  2. Ask how likely this hour's move is in each state. Calm hours move about ±0.26%, wild hours about ±0.86%.
  3. Combine the two. Multiply each state's chance from step 1 by how likely the move is in that state, then rescale so the two add to 100%. (This is Bayes' rule, from Thomas Bayes, published in 1763. A worked example is near the end.)

We wrote the model from scratch. Before using it, we checked it could recover a known model from data drawn from that model.

What we found (BTC, ETH and SOL, hourly and 4-hourly, two years):

3. Mean reversion: what drifts away tends to come back

The classic model (Ornstein–Uhlenbeck, 1930) is a ball on a rubber band tied to a post, knocked about at random:

The number to take away is the half-life: how long half of any gap takes to close. If a gap usually halves in six hours, you know how long to wait, and when a trade has gone stale.

Trading it: measure how unusual today's gap is, in "typical gaps". That number is the z-score. Buy when it is unusually low (say below −2), sell when it is unusually high, and get out near zero. Both are worked through near the end.

The catch: prices themselves rarely come back to a level. Bitcoin has no rubber band to a fixed price. What tends to come back are gaps between two things:

A grid bot is a mean-reversion strategy. It buys dips and sells bounces inside a range, betting that the price keeps coming back. It does well in a range and is hurt by a trend. That is why a model that could say "we are in a range now" would be worth so much to a grid. The hidden model above was our try at that, and it didn't beat random pausing.

Perpetual futures or options for mean reversion?

perpetual futuresoptions
payoffstraight line: up 1, gain 1curved: a buyer's loss is limited, and so is a seller's gain
suitsgaps that close in price: grids, pairs, basisvolatility that calms: selling options when it's high
running costfunding, paid or receivedtime decay: buyers pay it, sellers earn it
the dangerliquidation in a trenda plain seller can lose without limit in a crash, unless a spread caps it

4. First passage: the chance a price touches a level

How likely is the price to touch a level (a rung, a take-profit, a liquidation) within a given time? The textbook formula underprices far levels several times over; the market's own curve gives honest odds. It has a page of its own: First passage.

5. Order flow: who is pushing the price

The idea: price moves because one side is more eager. Every trade has an aggressor, the side that crossed the spread: a market buy takes the asking price, a market sell takes the bid.

For example, with the best bid at 99.90 and the best ask at 100, a market buy of one coin fills at 100: the buyer is the aggressor, and the trade counts as buying.

What we found (every trade on Bybit's public files: BTC over 30 days, ETH and SOL over 14 days, counted minute by minute):

Absorption is heavy one-way selling that barely moves the price: resting buyers are soaking it up, like a floor. The idea is that when absorption fails, the floor gives way and a trend follows.

We tested that on two years of Binance hourly data (BTC, ETH, SOL), choosing the settings on the first year and judging them on the second.

What it means: at a minute or an hour, order flow describes the market; it isn't a signal we could trade. Any edge lives in seconds, where the fastest firms are.

Where market data comes from

Every trade, order book, funding payment, liquidation and open-interest figure comes from an exchange's matching engine. Crypto exchanges publish most of it free, because data brings traders.

The maths, step by step

1. A transition table (the weather example above: sunny stays sunny 80%, rainy stays rainy 60%).

2. Bayes' rule, one hour of the hidden model (with the fitted numbers from section 2):

3. The standard deviation, also called σ (sigma): the typical size of a move or a gap away from its average. "±0.26% an hour" above is one standard deviation. Under a bell curve, about two moves in three fall within one standard deviation, and about 19 in 20 within two.

4. The z-score: how many standard deviations a value sits from its normal level.

5. The half-life: with the band's strength θ, half of any gap closes in ln(2) ÷ θ hours. Here ln(2) is the natural log of 2, about 0.693.

The pattern across all of these

Update, 16 October 2026: a clarification

Added after this page was published. The text above is left as it was.

Update, 21 October 2026: plain words

Added after this page was published. The text above is left as it was, except the explanations this lists.

Credits

How far to trust a Sharpe ratio →

Educational research from public market data; any trading discussed is paper, never real. Nothing here is advice. The full notice.