What problem does it solve?
Detect the market regime (Bull / Bear / Sideways) for any asset and turn it into a tradeable signal or a risk filter. Use this whenever the user wants regime detection, a regime-aware confirmation on an existing strategy, a regime risk gate, regime-based position sizing, a Markov transition matrix, n-step regime forecasting, a stationary regime mix, or a no-lookahead walk-forward regime backtest — on a ticker (via yfinance) or on the user's own CSV price series. Composes into any existing trading agent or strategy without rewriting it. Framework by Roan (@RohOnChain).
Core Features & Use Cases
- Regime detection and labeling for an asset, classifying days as Bull, Bear, or Sideways.
- Builds a 3×3 transition matrix and performs n-step regime forecasting to project regime dynamics.
- Emits a tradeable signal (bull_prob − bear_prob) and supports regime-based risk gating and position sizing.
- Optional HMM support via hmmlearn with graceful degradation if compilation fails.
Quick Start
Invoke the regime analysis with a ticker or CSV, for example uv run ${CLAUDE_PLUGIN_ROOT}/scripts/markov_regime.py --ticker BTC-USD --json.