We found a 50-percentage-point win rate spread between market regimes, fixed a regime classifier that was routing by symbol name instead of market structure, and built a live suppression system for anti-patterns.
62.1%
Win rate in choppy regime
12.3%
Win rate in trending regime
74%
Regime accuracy (post-fix)
19
Anti-patterns suppressed
CHAPTER 01
Market regime is the single most predictive feature in the Apex signal pipeline. This was not a design assumption. It was discovered empirically after auditing 13,266 usable live trades across a 12-day window. Segmenting by regime classification revealed a 50-percentage-point win rate spread: choppy regime produced 62.1% win rate; trending regime produced 12.3% win rate.
The problem was that the regime classifier in production was not classifying regime at all. The function infer_regime() classified by symbol name, not by market structure. A symbol whose ticker happened to match an internal string pattern would be routed to the choppy bucket; everything else fell to trending. The 62.1% win rate that made regime appear valuable was partly an artifact of which symbols the name-matching logic routed to which bucket.
All five mean-reversion discovery signals produced 0% win rate in the then-current trending crypto environment. These strategies had been tuned for equity sideways markets, where mean reversion is a structurally valid edge. In a trending crypto regime they were anti-patterns, systematically entering against momentum. The system had no mechanism to suppress them.
CHAPTER 02
The corrected regime classifier consumed five data inputs: ADX computed over a 14-bar lookback, price-to-MA200 ratio, 5-day momentum, realized volatility over a 20-day window, and funding rate for crypto symbols sourced from Binance 8-hour settlement across 719 symbols. A rule-based ensemble combined these inputs into one of five regime states: trending_up, trending_down, choppy, range_bound, or high_vol.
The Argus signal schema included both regime and regime_confidence fields in every emitted signal, making regime context a first-class component of the decision payload rather than a lookup that happened at execution time. Every signal was tagged at generation time with the regime in which Argus detected the pattern, and Apex's filtering layer enforced source-regime compatibility rules.
The crypto regime gate was implemented in safety/regime_gate.py, which blocked all disc_ strategies in trending regimes. The gate wrote 19 distinct anti-patterns to the brain's persistent memory, making the suppression durable across restarts.
ARCHITECTURE OVERVIEW
INGEST
Python 3.12 (regime gate)
FEATURES
Rust 1.84 (feature engine, argus-regime)
TRAIN
Redis 7.2
v1 / v2 / v3
SERVE
ClickHouse 26.3
Production predictions feed back into training set. Continuous retraining cadence
CHAPTER 03
The train/test methodology for regime validation used a 24-month lookback across the full symbol universe with walk-forward expanding windows. Each fold used 18 months for regime-label generation based on ex-post price trajectory and 6 months for out-of-sample evaluation. The regime label generation used a simple rule: if price moved more than 5% directionally over the next 20 bars, the regime at entry was labeled trending; if price stayed within a 3% band, it was labeled choppy or range_bound based on ADX.
The LTC-BTC contagion signal, confirmed at a Pearson correlation of r=0.52 on 60 days of minute-bar data, was wired as a regime-dependent trigger. When BTC moved more than 1% in either direction, LTC followed within 1 to 2 bars. SOL and LINK were decorrelated at r=-0.10 and r=-0.003 respectively, confirming that contagion was pair-specific rather than a general altcoin property.
TECH STACK
CHAPTER 04
After correcting the infer_regime() function to use actual market structure features rather than symbol name matching, regime classification accuracy on the held-out validation window reached 74% versus the ex-post trajectory label. The 50-point win rate spread between choppy and trending regimes remained, confirming that the spread was real and not purely an artifact of the broken classifier.
Supressing all disc_ strategies in trending regimes eliminated an entire category of losing trades. The 19 anti-patterns written to the brain's persistent memory represented the full set of mean-reversion entries that had fired during the April trending crypto environment. Regime key TTL enforcement reduced Redis memory usage for regime data by approximately 40% compared to the pre-fix accumulation state.
62.1%
Win rate in choppy regime
12.3%
Win rate in trending regime
74%
Regime accuracy (post-fix)
19
Anti-patterns suppressed
CHAPTER 05
DECISION · 01
The regime classifier failure was a silent corruption. The system appeared to work because regime keys existed in Redis and regime fields populated in signal payloads. Detecting this required comparing win rate by regime label against what the label should mean mechanistically, not just verifying that the code ran.
DECISION · 02
The decision to use rule-based regime classification rather than an ML-based classifier was deliberate. Rule-based classifiers are interpretable, debuggable, and stable under distribution shift. Given that regime misclassification cost 50 percentage points of win rate, interpretability and debuggability took priority over marginal accuracy gains.
DECISION · 03
The most durable architectural decision was embedding regime in the signal schema at emission time rather than inferring it at execution time. This made regime a property of the opportunity as Argus saw it, separate from the regime as Apex sees it when executing.
START A PROJECT
We build fast. Most projects ship in under two weeks. Start with a free 30-minute discovery call.
Start a ProjectWe rebuilt the signal scoring pipeline from scratch, fixing look-ahead contamination and adding a top-decile filter that produced 72.2% win rate on selected signals.
72.2% Win rate (top-decile signals)
Read case study →
AI / Machine LearningWe built a Rust correlation engine processing 1,200 symbols with incremental sliding window updates at 340ms p95 per cycle, 14x faster than full recompute.
1,200 Symbols in correlation matrix
Read case study →
AI / Machine LearningWe built a five-layer parallel context engine that synthesizes macro, sector, correlation, historical, and catalyst data into a 2-sentence market narrative within 1.5 seconds of signal emission.
1-1.5 sec Synthesis latency (p95)
Read case study →