regime

Classify market regimes and output structured trading signals from ticker or CSV data.

443|212|Updated May 19, 2026
One-click install
npx skills add https://github.com/jackson-video-resources/markov-hedge-fund-method --skill regime
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: regime
Source: https://github.com/jackson-video-resources/markov-hedge-fund-method/tree/main/skills/regime
Command: npx skills add https://github.com/jackson-video-resources/markov-hedge-fund-method --skill regime

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires yfinance, hmmlearn, and includes scripts (resource) and references (resource) components.

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.

Frequently Asked Questions about regime

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect market regimes for a specific stock ticker?

You can detect market regimes by passing a stock ticker to the script, which fetches price data via yfinance and classifies the current state as Bull, Bear, or Sideways. It outputs a tradeable signal and transition matrix.

Can I use my own CSV price data for regime classification?

Yes, the regime classifier accepts user-provided CSV price series as an alternative to tickers. It processes the custom data to identify the current market regime and generates a structured JSON signal for trading decisions.

What is a Markov transition matrix used for in market regime forecasting?

A Markov transition matrix projects regime dynamics by calculating the probability of shifting between Bull, Bear, and Sideways states. It enables n-step regime forecasting to anticipate future market conditions and guide position sizing.

How do I add a regime-aware risk gate to an existing trading strategy?

You can slot the regime detector into an existing strategy as a confirmation layer or risk gate. It emits a tradeable signal based on bull and bear probabilities, allowing you to filter trades without rewriting your framework.

Does the regime detector require hmmlearn to function properly?

No, the regime detector features graceful degradation if the hmmlearn dependency fails to compile. It still performs core Markov regime classification and outputs walk-forward backtest metrics without the optional HMM support.

Does the regime backtest suffer from lookahead bias?

No, the regime backtest is deterministic and explicitly designed with no-lookahead logic. It provides walk-forward metrics to ensure that regime signals are based strictly on historical data available at each point.