Skip to content

aether_quant.regime

The market regime vector.

The market regime vector.

MarketRegimeVector dataclass

The market's state on one bar: primary, trend, volatility and risk regimes, with the inputs behind them.

annualized_volatility instance-attribute

annualized_volatility: float

average_correlation instance-attribute

average_correlation: float

confidence instance-attribute

confidence: float

drawdown instance-attribute

drawdown: float

primary_regime instance-attribute

primary_regime: str

reasons instance-attribute

reasons: list[str]

risk_regime instance-attribute

risk_regime: str

risk_score instance-attribute

risk_score: float

rolling_volatility instance-attribute

rolling_volatility: float

trend_regime instance-attribute

trend_regime: str

trend_score instance-attribute

trend_score: float

volatility_regime instance-attribute

volatility_regime: str

to_dict

to_dict() -> dict[str, Any]

build_market_regime_vector

build_market_regime_vector(features: dict[str, Any], portfolio_drawdown: float = 0.0, average_correlation: float = 0.0, bullish_threshold: float = 0.02, bearish_threshold: float = -0.02, low_volatility_threshold: float = 0.01, high_volatility_threshold: float = 0.03, risk_off_drawdown_threshold: float = 0.08, risk_on_drawdown_threshold: float = 0.03, high_correlation_threshold: float = 0.75) -> MarketRegimeVector

Classify the market's trend, volatility and risk regimes from one bar's features, drawdown and correlation.

build_model_input_regime_vector

build_model_input_regime_vector(features: dict[str, Any], average_correlation: float = 0.0, bullish_threshold: float = 0.02, bearish_threshold: float = -0.02, low_volatility_threshold: float = 0.01, high_volatility_threshold: float = 0.03, risk_on_drawdown_threshold: float = 0.03, high_correlation_threshold: float = 0.75) -> MarketRegimeVector

The regime vector the MODELS read (regime_* one-hots and regime_signal_* scores). Portfolio drawdown is pinned to 0.0 because the training dataset has no account state, so the model never saw a drawdown-dependent regime input (V5.8.0, Problems.md #172: at an 8% live drawdown this moved the top/bottom-6 of the blended score by a third). The dataset builder and main.py::_build_model_input both call this; risk decisions keep using the real-drawdown vector from build_market_regime_vector.

classify_risk_regime

classify_risk_regime(trend_regime: str, volatility_regime: str, drawdown: float, average_correlation: float = 0.0, risk_off_drawdown_threshold: float = 0.08, risk_on_drawdown_threshold: float = 0.03, high_correlation_threshold: float = 0.75) -> tuple[str, float]

Risk-on, neutral or risk-off from the trend and volatility regimes, the drawdown and the average correlation.

classify_trend_regime

classify_trend_regime(momentum_5d: float, momentum_20d: float, bullish_threshold: float = 0.02, bearish_threshold: float = -0.02) -> tuple[str, float]

Bullish, bearish or sideways from 5- and 20-day momentum against the thresholds.

classify_volatility_state

classify_volatility_state(rolling_volatility: float, low_volatility_threshold: float = 0.01, high_volatility_threshold: float = 0.03) -> str

Low, normal or high volatility against the two thresholds.