Can a Hidden Markov Model Find Trading Regimes?

A Hidden Markov Model assumes the market is always in one of a few states you cannot see directly. I fitted one to order-flow data to look for states that lasted long enough to trade. Given one input it called direction correctly 50% of the time, the base rate. Given several inputs, the states it found were separated by how much the price was moving and not by which way it was moving, and the small directional signal in the raw input did not survive. This post covers what the model does, how to run inference without using future data, and what the added complexity cost.

June 29, 2026 · 9 min

Testing Whether Order Flow Can Predict Price

I implemented a 2010 order-flow paper on four years of tick data and reproduced its headline result: one number explains about two-thirds of contemporaneous price movement, an R² of 67%. I then tested six strategies for trading that signal. All of them were negative after the bid-ask spread, across four years of data.

June 28, 2026 · 9 min

Two Dozen Trading Strategies That Didn't Work

Twenty-five Pine strategy files and dozens of indicators. Most measured a real pattern, but none of the patterns held across a different test window, a realistic cost assumption, or a check on which trades produced the return. Cataloged by failure mode rather than by indicator.

June 14, 2026 · 5 min