Amberdata Blog

Crypto Pairs Trading: Part 2 — Verifying Mean Reversion with ADF and Hurst Tests

Written by Amberdata | Jan 13, 2025

Welcome to Crypto Pairs Trading: Part 2 — Verifying Mean Reversion with ADF and Hurst Tests. Building on the insights from Part 1: Foundations of Moving Beyond Correlation, here we apply robust statistical methods like the Augmented Dickey-Fuller (ADF) test and the Hurst exponent to confirm whether your chosen spreads truly revert to a stable mean. In one line: We validate the statistical backbone of your pairs strategy by proving that identified relationships aren’t just stable, but reliably mean-reverting.

Confirming Stationarity and Mean-Reversion Tendencies: The ADF Test and Hurst Exponent

Revisiting the Importance of Mean Reversion

At this stage, you know that cointegration provides a stable, long-term equilibrium for a pair of assets. However, having a cointegrated pair isn’t enough by itself. To confidently trade mean reversion, you must confirm that the spread formed by these assets truly returns to its average level over time. This requires verifying that the spread is stationary, ensuring it doesn’t drift endlessly but instead consistently “snaps back” toward its mean.

Stationarity: The Bedrock of Mean Reversion

A stationary series is one whose statistical characteristics—mean, variance, and autocorrelation structure—do not change as time progresses. If the spread is stationary, you can trust that when it deviates from its historical mean, it’s likely to revert. Without stationarity, the concept of a “mean” becomes meaningless, as the baseline could be moving, preventing any reliable prediction of a return.

The Augmented Dickey-Fuller (ADF) Test

To determine whether a time series is stationary, statisticians and quantitative traders commonly use the Augmented Dickey-Fuller (ADF) test. The ADF test checks for the presence of a “unit root,” a mathematical condition that signals non-stationarity.

  • What the ADF Test Does:
    The ADF test runs a regression that tries to detect whether changes in the time series are proportional to its recent history. If the series is a random walk or shows a persistent trend (non-stationary behavior), the test will fail to reject the null hypothesis of non-stationarity.
  • Interpreting the Results:
    • Null Hypothesis (H0): The series is non-stationary (has a unit root).
    • If the ADF p-value < chosen significance level (e.g., 0.05): You reject H0 and conclude that the series is likely stationary.
  • Setting a significance level is like defining your confidence standard. A commonly used threshold is 5%, meaning you want 95% confidence in your conclusion. If the ADF p-value is below 0.05, you’re essentially saying, “There’s less than a 5% chance we’d see this evidence if the series were actually non-stationary.” This statistical rigor ensures that you’re not just seeing a fluke of randomness.

The Hurst Exponent

While the ADF test answers, “Is this series stationary or not?”, the Hurst exponent provides deeper insight into the series’ underlying dynamics, telling you how the series behaves with respect to mean reversion or trending patterns.

  • What is the Hurst Exponent?
    The Hurst exponent (H) is a measure used in time series analysis to gauge the “long-term memory” or persistence of a process. It looks at how variability changes over different time scales.
  • Interpreting H Values:
    • H < 0.5: Mean-Reverting Behavior.
      A value under 0.5 suggests “anti-persistence,” meaning the series tends to reverse its direction. If it moves above its mean, it’s more likely to move back down soon, and vice versa. This is exactly what you want for a spread in pairs trading.
    • H = 0.5: Random Walk.
      A value around 0.5 suggests no memory—past behavior doesn’t influence the future. The series is equally likely to go up or down, offering no reliable mean-reversion signal.
    • H > 0.5: Persistence or Trending.
      Values above 0.5 indicate that the series has a tendency to continue moving in its current direction. Once it deviates, it’s more likely to keep going rather than revert, undermining mean-reversion strategies.

Combining ADF and Hurst for a Complete Picture:

  • ADF Success (p-value < 0.05): Confirms that the series is likely stationary. The spread has a stable statistical foundation, ensuring a mean exists that isn’t drifting with time.
  • H < 0.5: Provides confidence that not only is the series stationary, but it actively mean-reverts. The spread doesn’t just sit there; it “wants” to come back to the mean, enhancing the predictability of your trades.

To illustrate the above, imagine three example series, each with its own chart:

1. Stationary, Mean-Reverting (H < 0.5):
A series that oscillates around a stable mean, passing the ADF test with a low p-value and showing a Hurst exponent below 0.5. This is your ideal scenario—a spread that truly snaps back like a stretched rubber band.

2. Random Walk (H ≈ 0.5):
A series that fails the ADF test, indicating non-stationarity. It drifts aimlessly without a stable reference point. Even if it occasionally returns to some level, there’s no statistical reason to expect it to keep doing so.

3. Trending (H > 0.5):
A non-stationary series that also trends over time. The ADF test suggests it’s not anchored to a mean, and H > 0.5 means it persistently moves in one direction. Mean reversion signals here are unreliable, as the series lacks a natural pull back to a fixed average.

Refining Your Strategy with Statistical Confidence

Just as cointegration ensures a long-term equilibrium, the ADF test and Hurst exponent confirm that this equilibrium is meaningful and exploitable. By validating stationarity with ADF, you establish that a stable mean exists, and by checking H, you ensure the series actively returns to that mean rather than drifting or trending away. This reduces guesswork and risk, making your pairs trading strategy more robust and reliable in the volatile and unpredictable world of crypto assets.

Maintaining Control and Reducing Guesswork

  • Stationarity is Essential: Without a stationary spread, mean reversion strategies have no solid foundation.
  • Statistical Tools Matter: The ADF test provides a rigorous check, while the Hurst exponent offers additional insight into mean reversion strength.
  • Adaptation to Crypto: Since strong trends are common in crypto, finding pairs that produce a stationary, mean-reverting spread (ADF p-value < 0.05, H < 0.5) can be challenging but extremely rewarding. Your extra effort in confirming these statistical properties pays off in reduced risk and more predictable outcomes.

Looking Ahead

With stationarity and mean-reversion tendencies confirmed, you have a solid statistical footing. This sets the stage for integrating more advanced elements—like hedge ratios, transaction costs, and dynamic stop losses—into your strategy, further increasing your chance of success in the ever-changing cryptocurrency landscape.

Refining the Strategy with Logs, Hedge Ratios, and Z-Scores

Stabilizing with Logarithms:
Cryptocurrency prices can vary by orders of magnitude, and their volatility often grows with the price level. Taking the logarithm of prices helps level the playing field by stabilizing variance and making relationships more linear. This transformation:

  • Stabilizes Variance: High-priced assets won’t dominate the analysis simply because their absolute values are larger.
  • Aids Linear Modeling: When you fit a regression to find the hedge ratio or assess cointegration, working with logs can yield more reliable and interpretable results.

For instance, if Asset A trades at $10,000 and Asset B at $0.10, their raw prices differ enormously. Logging them narrows this gap, helping ensure that statistical tests and regressions are not unduly skewed by extreme values. In crypto markets, where an asset’s price might range from a fraction of a cent to tens of thousands of dollars, logs often prove indispensable.

Enforcing Bounds with Hedge Ratio Limits:
The hedge ratio determines how many units of one asset you need per unit of the other to form your spread. If the hedge ratio is extremely large or small, it might signal a spurious relationship. Consider a scenario where you need 1000 units of Asset B for every unit of Asset A—this might indicate that the model is forcing a relationship that isn’t genuinely stable.

By imposing reasonable limits on the hedge ratio, you ensure the pair’s relationship is both statistically sound and practically viable. A sensible hedge ratio suggests a well-defined equilibrium and reduces the risk that your strategy hinges on unrealistic position sizes.

Identifying Trading Opportunities with Z-Scores
Even after confirming stationarity and mean reversion, you need a systematic way to determine when to enter or exit trades. This is where Z-scores come in. The Z-score measures how many standard deviations the current spread is from its rolling mean:

  • Z-score > +2 or +3: The spread is significantly above its average, potentially signaling a short trade (betting it will revert downward).
  • Z-score < -2 or -3: The spread is significantly below its average, potentially signaling a long trade (betting it will revert upward).
  • Reverting to Zero: When the Z-score returns toward zero, it suggests the spread is moving back to its mean, offering a cue to exit and realize profits.

Visual Demonstrations and Comparisons:
Imagine three sets of charts:

1. Original vs. Log Prices:
The original prices may show wildly different scales and increasing variance. The logged prices appear more stable and linear, aiding regression-based estimation of the hedge ratio.

2. Unhedged vs. Hedged Spreads:
Without applying the hedge ratio, the spread may still drift or show no clear mean. Once you apply a sensible hedge ratio (e.g., from cointegration results), the hedged spread becomes more stable and visibly mean-reverting, making it suitable for trading decisions.

3. Z-Score Chart of the Hedged Spread:
A Z-score plot highlights when the spread deviates far from its mean. Horizontal lines at ±2 standard deviations serve as thresholds for potential trade entries. When the Z-score crosses these lines, it’s like a warning signal that conditions might be ripe for a mean-reversion trade.

Interpretation:

  • Original vs. Log Prices: Transforming prices with logs creates a more uniform analytical landscape, improving the stability and reliability of subsequent statistical procedures.
  • Hedge Ratio Limits: Ensuring the hedge ratio isn’t extreme reinforces that the cointegrated relationship is genuine, not forced. This step promotes both practical feasibility and statistical integrity.
  • Z-Scores for Signals: By quantifying how far the spread has strayed from its norm, Z-scores turn an abstract concept—mean reversion—into actionable signals for entry and exit.

Insight for Crypto Markets

In volatile crypto environments, sudden jumps or crashes can distort raw price relationships. Using logs normalizes these effects, and careful control of the hedge ratio keeps your model grounded. Z-scores translate statistical insights into clear trading signals, helping you respond systematically rather than emotionally to market extremes.

By combining log transformations, sensible hedge ratio constraints, and Z-score-based thresholds, you refine your pairs trading approach into a balanced, data-driven strategy. This measured approach helps ensure that when you act, you do so with greater confidence, aligning your trades more closely with the statistical realities underpinning mean reversion.

With mean-reversion statistically confirmed, you’re equipped with the confidence that your spreads are anchored by genuine equilibrium dynamics. Coming up in Part 3 — Constructing Your Strategy with Logs, Hedge Ratios, and Z-Scores, we’ll translate these findings into actionable tools—selecting pairs, refining with logs, setting hedge ratios, and using Z-scores—so you can systematically identify and capitalize on trading signals in live markets.

Turn validated insights into actionable strategies. Contact Amberdata now to access premium crypto market data and analytics, and optimize your approach to pairs trading.

Disclaimers

The information contained in this report is provided by Amberdata solely for educational and informational purposes. The contents of this report should not be construed as financial, investment, legal, tax, or any other form of professional advice. Amberdata does not provide personalized recommendations; any opinions or suggestions expressed in this report are for general informational purposes only.

Although Amberdata has made every effort to ensure the accuracy and completeness of the information provided, it cannot be held responsible for any errors, omissions, inaccuracies, or outdated information. Market conditions, regulations, and laws are subject to change, and readers should perform their own research and consult with a qualified professional before making any financial decisions or taking any actions based on the information provided in this report.

Past performance is not indicative of future results, and any investments discussed or mentioned in this report may not be suitable for all individuals or circumstances. Investing involves risks, and the value of investments can go up or down. Amberdata disclaims any liability for any loss or damage that may arise from the use of, or reliance on, the information contained in this report.

By accessing and using the information provided in this report, you agree to indemnify and hold harmless Amberdata, its affiliates, and their respective officers, directors, employees, and agents from and against any and all claims, losses, liabilities, damages, or expenses (including reasonable attorney’s fees) arising from your use of or reliance on the information contained herein.

Copyright © 2024 Amberdata. All rights reserved.