Setup-state language used below is editorial, the public-facing names of internal categorical labels. The actual rules for state assignment, transitions between states, and how each state interacts with the composite score are part of the engine’s edge and are not published. The intent here is to convey the kind of information the system reads, not the specific way it reads it.
Most trading systems treat a signal as a binary, fire or do not fire. The setup-state classifier is one of the things that separates a system that takes any breakout from a system that takes the right one. A breakout six months into an established uptrend is a different event than a breakout out of an eighteen-month base. The binary signal cannot tell them apart. The state classifier can.
The problem with binary signals
Suppose your signal is “the stock closed above its fifty-day moving average.” That is a fact about the stock today. It is not a fact about where the stock is in its own cycle. A name that crossed the MA50 yesterday after six months below it is in a completely different state than a name that has been above its MA50 every session for a year. Same signal, same boolean, radically different expected forward behaviour. The binary version of the signal blends them together and the system loses the distinction.
The same blindness shows up across every common signal feature. “Breaking out of consolidation” means very different things depending on whether the consolidation lasted a week or four months. “Above the rising MA200” means very different things depending on whether the MA200 just turned up or has been rising for a year. Without state, the system trades the signal name; with state, it trades the signal meaning.
The state machine
We classify every name in the investable universe into one of a small set of categorical states at evaluation time. The state is a coarse label, not a fine numerical reading, and it answers a question the binary signal cannot: where in its own cycle is this setup?
The public-facing names of the states, with the kind of situation each one captures, are below. The actual rule that places a name into each state is not published.
- Pre-breakout consolidation. The name has spent enough sessions in a tight range that the range itself has become the signal. Expected forward behaviour: low hit rate, most consolidations do not resolve to the upside, but the ones that do can produce the largest forward returns in the population. This is a high-variance state. We enter selectively.
- Approaching. Price is closing in on a measurable pivot. Not there yet. The signal is the proximity, not the cross. Approach states trade a lower hit rate, many names never clear the pivot, for a better average entry and less chase risk; where breakouts tend to follow through, the net expectancy can beat waiting for confirmation. The system favours approach over confirmation when the rest of the composite supports it.
- Fresh breakout. The pivot has just been crossed, the move is in its first few sessions, and the move is supported by volume that exceeds the name’s recent baseline. Expected forward behaviour: moderate hit rate, moderate expected return, lower drawdown than the pre-breakout variant because the thesis has at least begun to confirm.
- Extended. The breakout is well behind you. The name has been working for some time. The composite score is often highest in this state, the stock has done what the screen looks for. But the forward expectancy is the lowest of the bullish states, because most of the move has already happened. Extended names appear high on the ranking page because they look strong in isolation; the system trades them less aggressively than their score alone would suggest.
- Recently-broken. The name was in one of the bullish states above and the structure has changed, a meaningful adverse move, a breakdown back into the prior range, a volume signal that contradicts the prior thesis. We block re-entry on names in this state for a defined window. The discipline avoids the “average down on the stopped-out trade” pattern that produces most of the catastrophic drawdowns in retail systematic trading.
How the system uses state
The composite score is not a single function of the feature set; it reads the state and weights the underlying features differently depending on which state the name is in. The same raw composite reading in a pre-breakout state and an extended state means different things to the engine, and the engines themselves prefer different states.
Suzaku (the momentum engine) favours approach and fresh breakout. Genbu (the quality engine) is comfortable in extended states because the underlying thesis is durability, not timing. Byakko (the defensive engine) leans toward fresh-breakout reads on the narrow set of names that work in a hostile broad regime. Seiryū (the recovery engine) is mostly a transition reader , it sees a small set of large-caps moving out of defensive states and assigns the highest scores to the names that crossed first, in volume.
The state, in other words, is not a filter applied on top of the score. It is a context modifier that operates inside the score and inside each engine’s preference function. Removing it would not just change which trades fire, it would change what the score itself means.
What we deliberately keep undisclosed
We have described the categories qualitatively. We have not published the rules. The specific feature thresholds that place a name into each state, the transition logic between states, the lookback windows the state machine consults, and the way each state modifies the composite score are part of the engine’s production parameters.
The reason is not secrecy for its own sake. The reason is that the system’s edge lives in the joint distribution of the state labels with the rest of the feature set. Any single feature published in isolation reproduces only a fraction of the engine. The combinations are where the work is. A description of the categories, what kind of situation each one captures, gives the reader an honest picture of what the system is sensitive to without handing them the spine of the machinery.
That trade-off is deliberate. We want the methodology to be evaluable, readers should be able to form a view about whether the categorisation is sensible, whether the distinctions match how markets actually behave, whether the framework would survive contact with regimes outside our backtest window. We do not want the methodology to be replicable from public material alone. The published track and the published principle are the contract with the reader. The production rules are the work.
Why state-aware beats binary in the long run
Every common backtest mistake we have seen amounts to treating two structurally different situations as the same because they pass the same boolean signal. The state classifier exists to refuse that compression. The cost of refusing is engineering complexity: the system has more categories, more transition logic, more places to introduce subtle bugs. The benefit is that the backtest’s expected return for each named state actually matches the expected return when the live bot encounters that state in the wild.
A binary system has lower complexity and a backtest that overstates its forward expectancy. A state-aware system has higher complexity and a backtest that means what it says. We accept the complexity because we prefer the honesty.
Sources & further reading
- Lo, A. W., Mamaysky, H. & Wang, J. (2000). “Foundations of Technical Analysis: Computational Algorithms, Statistical Inference, and Empirical Implementation.” Journal of Finance, 55(4), 1705 to 1765.