Overview

System Documentation

A comprehensive guide to the Regime Trader platform, metrics, and models.

The Core Philosophy

The Regime Trader engine uses a Gaussian Hidden Markov Model (HMM) to classify market volatility environments. The model operates strictly as a volatility classifier and does not predict future price direction. Its role is to identify whether the market is calm, erratic, trending stably, or experiencing a crash. We use this "Regime" state to automatically inform our allocation layer—adjusting position sizes, risk limits, and leverage based on the perceived market safety.

Market Regimes Explained

Depending on the complexity of the trained model, the HMM will output anywhere from 3 to 7 underlying states. These numerical states are ranked by their expected volatility and labeled for human readability.

  • BULL / EUPHORIAAssociated with the lowest volatility states. Prices trend positively or safely drift. These states prompt full allocation risk and potential leverage.
  • NEUTRAL / BEARIntermediate volatility states. The market might be ranging or experiencing a moderate downtrend. Strategy reverts to cautious exposure and disables leverage.
  • DEEP BEAR / CRASHHigh volatility states characterized by rapid moves and gap-downs. Max exposure is typically halved, wide stops are enabled, and system acts defensively.

Regime Strategies

The numerical Rank of a regime directly dictates the allocation strategy assigned to it.

  • Low Vol Bull

    Deployed in the bottom 33% of volatile regimes. Enables strong (95%+) allocations and up to 1.25x leverage to maximize yield in safe environments.

  • Mid Vol Cautious

    Deployed in intermediate volatility. Allocates proportionally to recent short-term trend strength (e.g. via an EMA trend filter). Leverage is disabled (1.0x).

  • High Vol Defensive

    Deployed in the top 33% of volatile regimes. Max portfolio weight is hard-capped (e.g., 60%) to prevent critical drawdowns from fat-tail events.

Stop-Loss & Take-Profit Strategy

The ATR Metric — atr_norm_14

Stop distances are derived from ATR(14) normalized by close price — that is, the 14-period Average True Range divided by the current close, then Z-score standardized over a 252-bar rolling window. The result is a dimensionless volatility fraction: a value of 0.012means the average daily true range is 1.2% of price. Using a normalized ATR rather than a raw dollar amount ensures that stop widths automatically scale with the asset's current volatility — tighter in calm markets, appropriately wider when volatility picks up.

Multipliers by Regime

Each regime strategy multiplies atr_norm_14 by a different coefficient to set its stop-loss and take-profit distances:

RegimeStrategyStop-lossTake-profit
Low volatilityLOW_VOL_BULL3.0× ATR5.0× ATR
Mid volatilityMID_VOL_CAUTIOUS2.0× ATR4.0× ATR
High volatilityHIGH_VOL_DEFENSIVE1.5× ATR3.0× ATR

Design Notes

  • Counter-intuitive tightening in high vol: High volatility gets the narrowest multiplier (1.5×), not the widest. This is intentional — in a high-vol regime the Z-scored ATR is already a larger absolute number, so a tighter multiplier is needed to prevent the dollar-risk from exploding. The same 1.5× stop in a crash regime represents a much wider absolute distance than 1.5× in a calm market.
  • Fixed reward-to-risk ratio: All three regimes share a reward:risk ratio of exactly 1.67× (5÷3 = 4÷2 = 3÷1.5). There is currently no regime-adaptive R:R differentiation.
  • Signal outputs only: atr_stop_pct and atr_target_pct are stored in the regime_history table and passed to the order executor, which uses them to attach OCO bracket orders (take-profit limit + stop-loss stop) to each new position entry.

Technical Indicators & Features

The HMM classifies environments by observing standardized (Z-scored) technical indicators over time. Features are split into Core (v1) and Extended sets.

Core Feature Set

  • log_return_XLogarithmic price returns over 1, 5, and 20 bar windows. Helps the model understand short-term trajectory constraints.
  • realized_vol_20dA 20-period rolling standard deviation of daily log returns. Acts as the primary ground truth for realized volatility.
  • atr_norm_14Average True Range (14-period) divided by closing price. Normalizes volatility against the asset's nominal value.
  • sma_ratio_50_200Ratio of the 50-period Simple Moving Average to the 200-period Simple Moving Average. Provides a proxy for the macroeconomic trend.

Extended Feature Set

  • volume_zscoreZ-score of trade volume relative to a 50-bar rolling average. Detects sudden capitulation or euphoria events.
  • adx_14Average Directional Index (14-period). Measures the raw strength of the trend, irrespective of whether it's up or down.
  • rsi_zscore_1414-period Relative Strength Index, dynamically Z-scored over an optimal lookback window.
  • dist_from_sma200Percentage distance of price from its 200-period Simple Moving Average.

Dashboard Graphics

Regime Probability Chart

Visualizes the historical state probabilities computed by the HMM. We use strict forward-only ("filtered") probabilities, ensuring there is zero look-ahead bias as the model walks forward in time. This prevents the platform from retrospectively fixing its classifications.

Allocation Overlay Chart

Displays the active risk target percentage versus the prevailing asset price over time. This illustrates the system effectively reducing exposure during perceived crashes and dynamically loading up into steady bulls.

Flicker Rate

A bespoke anti-whipsaw statistic monitoring the frequency of regime changes per 20-bar window. An artificially high flicker rate means the HMM components are conflicting; thus, the allocation agent shifts into an Uncertainty fallback state and halves risk.