mean-reversion

Run ADF, Hurst, and variance ratio tests to assess mean reversion.

1|Updated May 15, 2026
One-click install
npx skills add https://github.com/dnkrow/skill --skill mean-reversion-dnkrow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mean-reversion
Source: https://github.com/dnkrow/skill/tree/main/claude-global/mean-reversion
Command: npx skills add https://github.com/dnkrow/skill --skill mean-reversion-dnkrow

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, pandas, scipy, httpx, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Mean-reversion analytics determine whether a price (or spread) series is statistically likely to revert to a long-run average, so you can build trading signals with measurable evidence rather than guesswork.

Core Features & Use Cases

  • Stationarity & mean-reversion validation: Runs ADF testing plus Hurst exponent and variance ratio checks to support or refute mean-reversion behavior.
  • Timing & signal construction: Estimates mean-reversion half-life and Ornstein–Uhlenbeck (OU) parameters, then turns deviations into z-score entry/exit/stop signals.
  • Pairs/spread workflow: Includes a scanner that evaluates pairwise combinations for correlation, Engle–Granger cointegration, spread Hurst, spread half-life, and current z-score-based spread signals.

Use Case: You suspect a crypto token is mean-reverting after a shock; you run the analysis to confirm stationarity and estimate half-life, then use the z-score framework to decide whether conditions are suitable for a mean-reversion long/short and what horizon to use.

Quick Start

Run the mean-reversion demo analysis using synthetic OU data to see a full report of ADF/Hurst/variance ratio/half-life/OU parameters and the current z-score signal for the series.

Frequently Asked Questions about mean-reversion

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

FAQPage Schema
How do I test if a price series is mean-reverting?

Mean reversion testing uses ADF, Hurst exponent, and variance ratio tests to validate stationarity. These checks confirm whether a price series is statistically likely to revert to a long-run average.

How do I calculate mean reversion half-life for a trading signal?

Mean reversion half-life is calculated using AR(1)-based estimation and Ornstein-Uhlenbeck parameter mapping. This determines the expected reversion horizon and feeds directly into z-score threshold logic for entry and exit signals.

Can I use Engle-Granger cointegration for pairs trading spread screening?

Yes, Engle-Granger cointegration is used for pairs trading spread screening. A scanner evaluates pairwise combinations for correlation, spread Hurst, spread half-life, and z-score signals across multiple candidate assets.

What's the best way to generate z-score entry and exit signals for a spread?

Z-score entry and exit signals are generated by applying z-score threshold logic to validated time series. This transforms price or spread deviations into actionable long, short, or stop signals.

Does this mean reversion analysis work with crypto analytics?

Yes, mean reversion analysis applies to crypto analytics. It supports single-asset crypto research and cointegrated pair spread screening across multiple candidate tokens using validated input time series.