Three Things About Market Regimes I Only Learned in Live
Suneet Malhotra
Apr 25, 2026
OpenClaw's regime classifier looks like a textbook implementation in code review. A rolling VIX percentile, a 50/200 EMA crossover for trend, and a realized-volatility expansion check. Three orthogonal signals, a finite state machine on top, transitions logged with timestamps. I built it in a weekend and felt like the design was clean.
It took six months of running it live, against real paper-trading entries and exits, before I learned the things that would have changed how I designed it. None of these were in any backtest I ran. None of them showed up on a Sharpe chart. They surfaced because the live system kept doing things I did not predict, and the only honest response was to read the log and figure out why.
1. Regimes flicker at the boundaries, and the flicker is the signal
The first thing I learned is that a regime classifier with hard thresholds will spend a noticeable fraction of any given week oscillating. A VIX print at 19.8 reads as low-vol; at 20.1 reads as expansion. If you let the classifier flip on every print, you will see the state toggle three or four times in a single afternoon on a borderline day.
My first instinct was to add hysteresis. Require a buffer between the up-flip and the down-flip thresholds. That works, and it cleans the log up nicely. What it does not do is help you trade.
The second-order observation took longer. The flicker is not noise to be filtered out. The fact that today's regime cannot make up its mind is a type of regime in its own right, and it deserves a strategy: do nothing. The log line that says "classifier flipped twice in 30 minutes" is more actionable than either side of the flip. I now treat repeated boundary flips inside a session as an explicit signal to size down or sit out, not as an artifact to suppress.
2. The expensive regime is not the obvious one
If you ask anyone who has not run this in production, they will tell you that high-vol panic regimes are the dangerous ones. They are not wrong, but they are wrong about why.
In live trading, my high-vol panic days are profitable on average. The strategies I deploy in that regime are defensive by construction: tight stops, smaller size, defined-risk only. The realized losses in that regime are bounded.
The expensive regime is the low-vol, drifting one. It looks safe. It looks like a regime where nothing bad happens. What it is, in fact, is a regime where my classifier's signal-to-noise is at its worst. Range-bound chop, narrow ATR, and a flat 50/200 EMA all conspire to make every entry look marginal. I take more trades, win a slightly higher percentage on average, and lose more in absolute dollars to slippage and commissions than I make on the wins. The first time I noticed this, I had to look at the trade log three times to convince myself the boring regime was the one bleeding me.
The fix was to raise the bias-score threshold for any trade taken in low-vol drift specifically. Not blanket, just for that one regime. The number of trades dropped by about a third. The dollar P&L from that regime turned positive within a month.
3. The classifier is a confidence model, not a label
The third thing I learned is the most uncomfortable. My classifier outputs one of three labels: trending, range-bound, high-vol panic. That was the original design. In live trading, I started writing the classifier's raw inputs to the log next to the label, and I noticed that the label hides almost all of the useful information.
A trending call where the EMA spread is one ATR is doing different work than a trending call where the spread is four ATRs. A range-bound call where realized vol has been compressing for a week is more actionable than the same label in the third week of chop. The label is a categorical projection of a continuous state, and the projection throws away the part of the state that matters most.
I have not rewritten the classifier yet. The next iteration will output a tuple: regime label, plus a confidence-or-strength score derived from how far the underlying inputs are from the threshold boundaries. The label tells me which strategy class to consider. The strength score tells me how much to size, and how much to discount everything.
The engineering takeaway
None of this was learnable from a backtest curve. The classifier looked the same. The Sharpe looked the same. The lessons came from running the live log next to the trade journal and asking, every time the system did something I did not expect, what part of my model I had not bothered to write down. The log was telling me. I just had to read it.
If you are building a regime-aware system, the most useful instrument you can add is not a better classifier. It is a log line that emits, every time the state flips, the raw inputs that drove the decision. Then read it. Most of the assumptions you baked in at design time will not survive a quarter of live data, and the ones that need replacing will tell you so themselves.
Share this post
You Might Also Like
The Check That Passes Until the Day It Does Not
Every day my engine reconciles its own record of open positions against the broker's. Almost every day the two lists match. I do not run the check for those days.
OpenClaw TutorialsThe Three-Percent Daily Stop That Freezes at $3,000
My engine has two daily loss limits: three percent of equity and a flat $3,000. They are the same number on exactly one day, the day the account opened. After that they quietly diverge.
Quantitative TradingA Retry Is Not a Trading Decision
A rejected order is a decision. Retrying it without preserving the reason can turn a risk control into a duplicate trade.
Agentic AIThe Log Is Part of the Agent's Interface
An agent that can act but cannot leave a useful decision record is not autonomous. It is an opaque process with write access.
Latest Blog Posts
A Retry Is Not a Trading Decision
A rejected order is a decision. Retrying it without preserving the reason can turn a risk control into a duplicate trade.
The Log Is Part of the Agent's Interface
An agent that can act but cannot leave a useful decision record is not autonomous. It is an opaque process with write access.
The Market Is Closed Is Not a Trading Rule
A backtest can know the exchange hours and still schedule a trade into a holiday, an early close, or a stale session. Calendar state is market data.
Related Tools & Demos
The QA Field Manual to Language Models
A free 24-chapter book. Start at “what is AI, really?” and finish with a small language model you built yourself — one that reads a failing Playwright test and proposes a fix you can run. Read it in your browser, or download the PDF or the Mac app.
View Source Code →Multi-Model LLM Harness
One interface to call any AI model — capability routing, fallback chains, budgets, circuit breakers, and a quality feedback loop. A practical architecture pattern write-up.
Automated Trading System
Multi-engine trading platform with real-time risk management, regime-based strategy selection, and automated order execution.
View Source Code →
Stay in the Loop
Get weekly insights on AI-driven QA, engineering leadership, and automation strategies.
No spam, ever. Unsubscribe anytime.