regime-detection
Regime Detection classifies market conditions across volatility and trend axes to help you choose the right strategy for current conditions. It combines simple approaches like ATR percentiles and ADX with statistical methods including Hurst exponent and change-point detection, with tuning for crypto's faster regime shifts.
Regime Detection identifies your current market regime to guide strategy selection and position sizing.
AI-generated summary based on this skill's SKILL.md
Install
agiprolabs/claude-trading-skills/regime-detection · repository language: Python
git clone https://github.com/agiprolabs/claude-trading-skills
cp -r claude-trading-skills/skills/regime-detection ~/.claude/skills/regime-detectionFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How does regime-detection identify trending vs ranging markets?
Regime Detection combines ADX trend strength with statistical methods like Hurst exponent to classify market behavior. ADX measures directional momentum, while Hurst exponent detects mean-reversion versus trending persistence. The skill also monitors Bollinger Band squeeze and CUSUM change-point detection to spot transitions between choppy ranges and clean trends, tuned for crypto's faster regime shifts.
What market regime detection methods does this skill use?
Regime Detection applies multiple approaches: ATR volatility percentiles and Bollinger Band squeeze for volatility classification, ADX for trend strength, Hurst exponent for mean-reversion detection, and CUSUM for change-point identification. These combine into a regime quadrant (volatility × trend axes) without requiring machine learning, making it transparent and fast for adaptive strategy selection.
How can I use regime detection for position sizing and risk management?
Regime Detection measures volatility and classifies the current regime quadrant, enabling you to scale position size accordingly. High-volatility regimes warrant smaller positions; low-volatility trending conditions allow larger exposure. The skill also adapts stop losses and risk limits based on detected regime, helping you align risk parameters with current market conditions.
When should I use trend following versus mean reversion strategies?
Regime Detection applies statistical methods including Hurst exponent to classify trending versus mean-reversion behavior. In trending regimes (high ADX, high Hurst), follow the trend. In ranging regimes (low ADX, low Hurst), use mean-reversion. The skill detects these transitions automatically, helping you select the appropriate strategy for current market conditions without manual regime assessment.
How does regime-detection adapt to crypto market regime changes?
Regime Detection is tuned for crypto's faster and more volatile regime shifts compared to traditional markets. It uses rapid change-point detection via CUSUM and volatility clustering analysis to catch transitions quickly. ATR percentiles and volatility regime classification adjust dynamically, enabling crypto traders to adapt position sizing and strategy selection as market conditions evolve.
What is the license for regime-detection?
Regime Detection is released under the MIT license, allowing free use, modification, and distribution for both commercial and personal projects with minimal restrictions.
SKILL.md
rendered from the published skill — quoted content, verbatim
Regime Detection
Identify the current market regime so you can pick the right strategy, size positions correctly, and avoid deploying trend-following logic in a ranging market (or vice versa).
Why Regime Detection Matters
Every strategy has a "home regime." A momentum strategy prints money in a clean uptrend but bleeds in a choppy range. A mean-reversion grid thrives in low-volatility consolidation but gets steamrolled by a trending breakout. Regime detection tells you which playbook to use right now.
Key benefits: - Strategy selection: Route signals to the right strategy for the current environment - Position sizing: Reduce exposure in hostile regimes, increase in favorable ones - Stop adaptation: Wider stops in high-vol regimes, tighter in low-vol trends - Drawdown control: Sit out "danger zone" regimes (high vol + no trend)
Core Regime Dimensions
Two orthogonal axes define the four-quadrant regime model:
| Low Volatility | High Volatility | |
|---|---|---|
| Trending | Q1: |
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 5 files
skills/regime-detection/SKILL.md
skills/regime-detection/references/methodology.md
skills/regime-detection/references/strategy_adaptation.md
skills/regime-detection/scripts/detect_regime.py
skills/regime-detection/scripts/regime_backtest.py