Autocorrelation of Returns
10 min read
Detect non-random patterns in your trade sequence — do wins cluster, or alternate with losses?
10 min read
Detect non-random patterns in your trade sequence — do wins cluster, or alternate with losses?
Autocorrelation measures whether your trade outcomes are statistically related to previous outcomes. In plain terms: do your wins tend to cluster together? Do losses follow losses? Or are your results truly independent?
This lesson is about autocorrelation of your trade-return sequence (R-multiples of trade 1, 2, 3, …), not the underlying asset's price returns. They are related but distinct: asset returns are usually near-zero AC daily, slightly positive intraday (momentum), slightly negative on weekly horizons (mean reversion). Trade-sequence AC tells you about your strategy's behavior across regimes, not about the market itself.
Quick glossary — Lag k: how many trades back you compare. Serial correlation: same as autocorrelation. ACF: autocorrelation function plotted across lags. Block bootstrap: resampling contiguous chunks to preserve serial structure.
Autocorrelation (serial correlation) at lag k is ρ(k) = Cov(rₜ, rₜ₋ₖ) / Var(rₜ), bounded in [-1, +1]. For lag 1 on a trade-return series:
AC(1) = Σᵢ₌₂..ₙ[(Rᵢ - R̄)(Rᵢ₋₁ - R̄)] / Σᵢ₌₁..ₙ[(Rᵢ - R̄)²]
where Rᵢ = return of trade i, R̄ = mean return across all N trades, the sum runs from i = 2 to N, and the denominator is the sample variance proxy. Result is bounded in [-1, +1].
For formal significance use the Ljung–Box Q-statistic (or Box–Pierce, Durbin–Watson at lag 1) — the ±1.96/√N rule below is only a quick white-noise sanity check.
| AC(1) Value | Pattern | Implication |
|---|---|---|
| +0.3 to +1.0 | Strong positive | Wins follow wins, losses follow losses (streaks) |
| +0.1 to +0.3 | Mild positive | Slight clustering tendency |
| -0.1 to +0.1 | Near zero | Results are approximately independent |
| -0.3 to -0.1 | Mild negative | Alternating pattern (win-loss-win-loss) |
| -1.0 to -0.3 | Strong negative | Strong alternation |
If your per-trade returns have AC(1) ≈ 0, each trade is effectively independent of the previous one. Caution: do not run AC on the cumulative equity curve — a cumulative sum is always strongly autocorrelated by construction and tells you nothing about trade independence. Always compute AC on incremental R-multiples or P&L per trade. This is the assumption behind most position sizing models — Kelly criterion, fixed fractional — and the foundational variance and risk-of-ruin formulas in this course.
If AC(1) is significantly positive (say > +0.2), your strategy exhibits momentum in returns — winning streaks and losing streaks are longer than random chance would predict. This could be because:
If AC(1) is significantly negative (say < -0.2), your returns tend to alternate. This could mean:
Common mistake to avoid first: never compute AC on the cumulative equity curve. A cumulative sum is always near-perfectly autocorrelated regardless of whether the underlying trades are IID. AC must be computed on per-trade increments (R-multiples, P&L, or log-returns of equity), not on equity levels.
If returns are positively autocorrelated, you can increase size during winning streaks and decrease during losing streaks — a momentum-based sizing approach. If returns are negatively autocorrelated, the opposite might work.
But if returns are near zero autocorrelation, any streak-based sizing adjustment is just noise-fitting.
Standard risk-of-ruin formulas assume independent trades (AC ≈ 0). With AC = 0.2–0.3 in your trade sequence, simulated 99th-percentile drawdowns can run 1.5–2x deeper than IID predicts at the same mean and vol. Losing streaks are longer than random because adjacent losses share the same regime.
When trade-sequence AC = 0.2–0.3 vs the IID baseline at the same mean and volatility, simulated 99th-percentile drawdowns run roughly 1.5–2x deeper because losing streaks are longer than random.
If you run Monte Carlo simulations by randomly shuffling trade results, you destroy any autocorrelation structure. If the original returns had significant autocorrelation, the Monte Carlo results will underestimate tail risks.
To fix this, use block bootstrapping — sampling contiguous blocks of trades rather than individual — to preserve the serial correlation structure. Pick block length L ≈ N^(1/3) (so ~5 for N=125, ~10 for N=1000), or set L to the smallest lag at which the ACF decays into the ±1.96/√N band. Stationary bootstrap (Politis & Romano, 1994) is a more robust alternative; see López de Prado, Advances in Financial Machine Learning, Ch. 4 for block-bootstrap practice in finance.
Near-zero AC means your edge does not depend on regime persistence — your risk-of-ruin formulas are valid as written. Positive AC is not automatically bad: a momentum strategy will produce positively-autocorrelated trade outcomes by design. The danger is when AC is high and unintended — that usually means your edge depends on a single market regime persisting, which fattens DD distributions beyond what an IID model predicts. Regime sensitivity is the deeper diagnostic when AC is high.
Lag-1 autocorrelation is the most common, but checking higher lags can reveal deeper patterns:
Plot the autocorrelation function (ACF) for lags 1 through 20. If all values are within the 95% confidence bounds (approximately ±2/√N), there is no significant serial correlation at any lag.
Example: 200 trade R-multiples, mean R = 0.18, std = 1.2. Compute AC(1) in Python:
import numpy as np
from statsmodels.tsa.stattools import acf
from statsmodels.stats.diagnostic import acorr_ljungbox
r = np.array([...]) # 200 trade R-multiples
print(acf(r, nlags=20, fft=False))
print(acorr_ljungbox(r, lags=[5, 10, 20]))
If AC(1) = 0.31 with N=200, the 95% band is ±0.139 — clearly significant. Then:
Often, autocorrelation in trade results is not a market phenomenon — it is a trader phenomenon. Confidence after wins leads to overtrading (extending winning streaks). Fear after losses leads to hesitation (extending losing streaks).
If you find significant autocorrelation, the first question should be: "Is this the market, or is this me?"
The Monte Carlo simulator below shuffles trade ordering randomly. If your actual returns show significant autocorrelation, the random shuffling will underestimate tail risk — some paths below may look safer than your real experience.
No. The equity curve is a cumulative sum and will always be highly autocorrelated by construction, regardless of whether the underlying trades are independent. Always compute AC on per-trade R-multiples, P&L per trade, or log-returns of equity — not on equity levels.
At least 100 trades for a meaningful ±1.96/√N white-noise band (which gives ±0.196 at N=100). For Ljung–Box at multiple lags you want 200+ trades. Below 100 trades, any AC reading should be treated as noise.
Yes — if you used the standard IID formula. With AC = 0.2–0.3 in your trade sequence, simulated 99th-percentile drawdowns can run roughly 1.5–2x deeper than IID predicts at the same mean and vol, because losing streaks are longer than random.
Trade-sequence AC measures dependence in your strategy's outcomes (R-multiples of trade 1, 2, 3, …). Asset-return AC measures dependence in the underlying price returns. Asset returns are usually near-zero AC daily, slightly positive intraday, slightly negative weekly. Trade-sequence AC tells you about your strategy's regime behavior, not the market.
Autocorrelation is a diagnostic metric, not a performance metric. It tells you nothing about how much you made — only about the structure of your results. But that structure has profound implications for risk management, position sizing, and the validity of your backtesting methodology. Ignore it, and your risk models may be quietly lying to you.
Next: Equity R-Squared — autocorrelation tells you about trade-level dependence; equity R² tells you whether the resulting path is smooth or jagged. Together they characterize the structure of your returns.