Regime Detection¶
Regime detection classifies market state and can be consumed by strategies, risk limits, or reporting. The detector is configured under regime (C++ config) or regime_detector and regime_params (Python config).
Detector Types¶
constantreturns a fixed regime label.hmmuses a Hidden Markov Model.ensembleaggregates multiple detectors.- Plugins can provide custom detectors.
Constant Detector¶
Config keys:
regime.detector: constantregime.regimevalue:bull,neutral,bear,crisis.
HMM Detector¶
Config keys:
regime.detector: hmmregime.hmm.statesinteger.regime.hmm.windowinteger.regime.hmm.normalize_featuresboolean.regime.hmm.normalizationstring, e.g.zscore.regime.hmm.kalman_enabledboolean.regime.hmm.kalman_process_noisedouble.regime.hmm.kalman_measurement_noisedouble.
Example:
regime:
detector: hmm
hmm:
states: 4
window: 20
normalize_features: true
normalization: zscore
kalman_enabled: true
kalman_process_noise: 1e-3
kalman_measurement_noise: 1e-2
Ensemble Detector¶
Config keys:
regime.detector: ensembleregime.ensemble.voting_methodvalues:weighted_average,majority,confidence_weighted,bayesian.regime.ensemble.detectorslist of detector configs.regime.ensemble.detectors[].weightweighting per detector.
Example:
regime:
detector: ensemble
ensemble:
voting_method: weighted_average
detectors:
- type: hmm
weight: 0.7
params:
hmm:
states: 4
window: 20
- type: constant
weight: 0.3
params:
regime: neutral
Plugin Detectors¶
Plugin detectors are created through RegimeFactory. Provide the plugin name in regime.detector, and pass plugin parameters in regime.params.
Next Steps¶
guide/strategies.mdguide/risk-management.mdreference/configuration.md