[{"data":1,"prerenderedAt":244},["ShallowReactive",2],{"blog-quant-markov":3},{"id":4,"title":5,"body":6,"date":227,"description":228,"extension":229,"featured":230,"meta":231,"navigation":232,"path":233,"seo":234,"series":235,"stem":236,"tags":237,"tldr":242,"__hash__":243},"blog\u002Fblog\u002Fquant-markov.md","Regime Detection — The Simple Approach That Works",{"type":7,"value":8,"toc":215},"minimark",[9,21,24,31,34,39,42,53,63,69,72,76,79,85,91,97,103,106,110,113,116,120,123,126,129,132,136,139,152,155,158,161,165,171,177,183,189,192,196,199,202,205,209,212],[10,11,12,13,20],"p",{},"Inspired by ",[14,15,19],"a",{"href":16,"rel":17},"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=CkXljL6eI5A",[18],"nofollow","Roman Paolucci",". Go watch his stuff. It's good.",[10,22,23],{},"Here's something that actually works. Not fancy. Not complicated. Just useful.",[10,25,26,27],{},"Regime detection is figuring out what kind of market you're in before you trade it. Markets exist in different states. Some favour trend following. Some favour mean reversion. Some want you to stay away entirely. The trick is knowing which state you're in. ",[28,29,30],"em",{},"That's the whole game.",[10,32,33],{},"Think of it like weather. You don't wear a raincoat when it's sunny. You don't trade aggressively when the market is volatile. You adjust based on conditions. That's it.",[35,36,38],"h2",{"id":37},"the-three-things-that-matter","The Three Things That Matter",[10,40,41],{},"I learned this from losing money, not from textbooks. Three things determine the regime.",[10,43,44,48,49,52],{},[45,46,47],"strong",{},"Trend strength"," — How strong is the current move? A trending market moves in one direction consistently. A ranging market goes nowhere. There's a standard indicator for this — been around for decades. It measures directional movement. Not up or down. Just ",[28,50,51],{},"how strong",". When trend strength is high, trends tend to continue. When it's low, they tend to reverse. That's the key insight.",[10,54,55,58,59,62],{},[45,56,57],{},"Return direction"," — Where has the market been moving? Not predicting. Observing. Positive recent returns = bullish bias. Negative = bearish bias. This sounds obvious because it ",[28,60,61],{},"is"," obvious. Don't overcomplicate what works.",[10,64,65,68],{},[45,66,67],{},"Relative volatility"," — Is the market more volatile than usual, or less? High volatility = stressed market = danger = smaller positions. Low volatility = calm = normal positions.",[10,70,71],{},"That's it. Three numbers at every bar. Classify the regime. Only take trades that match. Size based on clarity.",[35,73,75],{"id":74},"why-not-machine-learning","Why Not Machine Learning?",[10,77,78],{},"I tried ML approaches. Hidden Markov Models. Gaussian mixtures. Neural networks. Here's what happened:",[10,80,81,84],{},[45,82,83],{},"Inconsistent."," Same data, different results. Run it twice, get different regimes.",[10,86,87,90],{},[45,88,89],{},"Overfitted."," Backtests looked amazing. Forward tests failed. The model memorized, didn't learn.",[10,92,93,96],{},[45,94,95],{},"Uninterpretable."," Even when it worked, I couldn't explain why. If I can't explain it, I can't trust it.",[10,98,99,102],{},[45,100,101],{},"Drifted."," What worked last year doesn't work this year. Constant retraining. Added complexity without added value.",[10,104,105],{},"The assumptions behind ML (stationarity, ergodicity, convergence) don't hold in markets. The math itself is suspect. ML is a tool, not magic. Know when to use it, and more importantly, know when not to.",[35,107,109],{"id":108},"what-actually-works","What Actually Works",[10,111,112],{},"Simplicity. Deterministic — same inputs, same outputs every time. No random seeds, no variation. Interpretable — you can see exactly why the regime was classified that way. Testable — validate on historical data independently. Robust — doesn't drift, doesn't break, doesn't need constant retraining.",[10,114,115],{},"Sometimes the fancy solution isn't the better solution. Simplicity wins.",[35,117,119],{"id":118},"the-markov-property-briefly","The Markov Property (Briefly)",[10,121,122],{},"A stochastic process is Markov if the future depends only on the present, not the past. In markets? Debatable. The assumption doesn't hold perfectly, but it approximates reasonably well on short timeframes. That's good enough for regime detection. You're not predicting the next price — you're classifying the current environment.",[10,124,125],{},"Stationarity is the bigger problem. A process is stationary if its statistical properties don't change over time. Financial returns aren't stationary. That's the fundamental challenge. The variance changes, the regimes change, the relationships break.",[10,127,128],{},"The academic approach uses hidden states with transitions governed by a Markov chain, then infers states via the Baum-Welch algorithm. The problem: convergence isn't guaranteed. Multiple local optima exist. Different initializations give different results. That's not robust.",[10,130,131],{},"My approach: observe the states directly. The regime is what you see, not what you infer. That's simpler. Sometimes simpler is better.",[35,133,135],{"id":134},"the-test-that-matters","The Test That Matters",[10,137,138],{},"Not backtests. Walk-forward testing.",[140,141,142,146,149],"ul",{},[143,144,145],"li",{},"Train on earlier data. Test on later data.",[143,147,148],{},"Roll forward. Repeat.",[143,150,151],{},"Compare filtered vs unfiltered performance.",[10,153,154],{},"That's the only test that matters. If it works forward, it works. If it doesn't, it doesn't.",[10,156,157],{},"My hypothesis was simple: certain regime conditions favour trend continuation. Test: run with and without the filter. Compare. The filtered version performed better. That's validation.",[10,159,160],{},"Backtests lie. Walk-forward tells truth.",[35,162,164],{"id":163},"what-this-gives-you","What This Gives You",[10,166,167,170],{},[45,168,169],{},"Context"," — You know what environment you're trading in. That's crucial.",[10,172,173,176],{},[45,174,175],{},"Filtering"," — You only take trades that match conditions. That's edge preservation.",[10,178,179,182],{},[45,180,181],{},"Risk management"," — You size based on clarity. Ambiguous regimes mean smaller trades.",[10,184,185,188],{},[45,186,187],{},"Process"," — You're not guessing. You're responding. That's systematic.",[10,190,191],{},"The goal isn't to predict. It's to adapt.",[35,193,195],{"id":194},"limitations-being-honest","Limitations (Being Honest)",[10,197,198],{},"Regime detection lags. The market enters a new regime, the indicators catch up, and by then you're one step behind. Accept it. Manage it.",[10,200,201],{},"The lookback periods matter. You can overfit them. Don't tune on in-sample only — walk-forward validate.",[10,203,204],{},"Markets can switch regimes instantly. The detection is retrospective. Nobody predicts regime changes. Nobody.",[35,206,208],{"id":207},"the-takeaway","The Takeaway",[10,210,211],{},"Markets have regimes. Understand the state you're trading in. Simple beats complex. Deterministic beats stochastic. Interpretable beats impressive. Test everything — walk-forward validates, backtests lie. ML isn't magic, it's a tool.",[10,213,214],{},"The quant journey isn't about finding perfection. It's about building process, testing it, and improving it. Now go build something simple. Test it. Break it. Fix it. That's how it's done.",{"title":216,"searchDepth":217,"depth":217,"links":218},"",2,[219,220,221,222,223,224,225,226],{"id":37,"depth":217,"text":38},{"id":74,"depth":217,"text":75},{"id":108,"depth":217,"text":109},{"id":118,"depth":217,"text":119},{"id":134,"depth":217,"text":135},{"id":163,"depth":217,"text":164},{"id":194,"depth":217,"text":195},{"id":207,"depth":217,"text":208},"2026-04-17","Why I stopped using HMMs and went back to basics. Trend strength, return direction, and relative volatility. No ML, no black boxes.","md",false,{},true,"\u002Fblog\u002Fquant-markov",{"title":5,"description":228},"Quant Journey","blog\u002Fquant-markov",[238,239,240,241],"trading","quant","regime","systematic","HMMs are overkill. Three simple indicators — trend strength, return direction, relative volatility — classify market regimes better than anything ML can do. Deterministic, interpretable, and walk-forward validated.","xN40cOBcqhCcQ2JtytFgdDRv_ri5wA9IUKM2c_WCrOo",1781978556347]