Autocorrelation -- Return Autocorrelation

Contents


Overview

Autocorrelation measures the correlation of an asset's returns with their own lagged values over a rolling 100-candle window. At lag 1, it answers the question: "does this candle's return predict the next candle's return?" At lag 5, it asks: "does this candle's return predict the return 5 candles from now?"

The calculation is a standard Pearson correlation between two series: the return series returns[t] and its lagged copy returns[t - lag], computed over the most recent 100 candles. The result is a single number between -1 and +1, updated every candle as the rolling window advances.

This is the momentum validator -- the indicator that tells you whether momentum strategies have any edge in the current market. Before running any trend-following or momentum strategy, autocorrelation answers the fundamental question: is there exploitable serial dependence in returns, or is the market a random walk? Positive autocorrelation means today's direction predicts tomorrow's -- momentum strategies will work. Negative autocorrelation means today's direction predicts tomorrow will reverse -- mean reversion strategies will work. Near-zero autocorrelation means neither has an edge -- the market is noise.


Format

autocorr_{lag}

The parameter is lag, not period. Lag defines how many steps back in the return series the correlation is computed against. The rolling window for the correlation calculation is always a fixed 100 candles internally.

ExampleLagUse Case
autocorr_11One-step momentum -- the primary signal. Does this candle predict the next?
autocorr_22Two-step -- captures slightly longer persistence patterns
autocorr_55Medium-horizon -- momentum at the 5-candle scale
autocorr_1010Longer-horizon -- structural momentum that persists across many candles

Lag range: 1 to 50. Recommended: 1, 2, 5, 10.

Value range: -1 to +1 (Pearson correlation coefficient).


Understanding Autocorrelation Values

Autocorrelation RangeInterpretation
Below -0.2Strong mean reversion -- today's direction strongly predicts tomorrow will reverse. Mean-reversion strategies have a significant edge. Statistically significant.
-0.2 to -0.1Weak mean reversion -- some tendency to reverse, but the signal is marginal. Momentum strategies should be avoided.
-0.1 to 0.1Random walk zone -- no exploitable serial dependence. Neither momentum nor mean-reversion strategies have a reliable edge. This is noise, not signal.
0.1 to 0.2Weak momentum -- some tendency to persist, but the signal is marginal. Trend-following can work but with reduced confidence.
Above 0.2Strong momentum -- today's direction strongly predicts tomorrow will continue. Trend-following and momentum strategies have a significant edge. Statistically significant.

Note

Statistical significance for a 100-candle window is |autocorrelation| > 2/sqrt(100) = 0.2. Values between -0.1 and 0.1 are almost certainly noise. Values between 0.1 and 0.2 (or -0.1 and -0.2) are suggestive but not statistically significant -- use them with caution and combine with other confirming indicators.


Understanding Operators with Autocorrelation

Each operator behaves differently with autocorrelation. Because autocorrelation is a regime filter (it describes the market's current statistical structure, not trading direction), it is almost always used in combination with directional triggers.

> (Greater Than) -- State-Based

What it does: The trigger is true on every candle where autocorrelation is above the threshold.

On the chart: The market is exhibiting momentum behavior. Returns are positively correlated with their lagged values -- moves tend to continue. This trigger stays active for as long as the momentum regime persists.

[[actions.triggers]]
indicator = "autocorr_1"
operator = ">"
target = "0.1"
timeframe = "1d"

Typical use: "Only run momentum strategies when autocorrelation confirms momentum is real." This is the primary use case -- gate your trend-following entries behind an autocorrelation check so you do not trade momentum in a random or mean-reverting market.

< (Less Than) -- State-Based

What it does: The trigger is true on every candle where autocorrelation is below the threshold.

On the chart: The market is exhibiting mean-reverting behavior. Returns are negatively correlated with their lagged values -- moves tend to reverse. This trigger stays active for as long as the mean-reversion regime persists.

[[actions.triggers]]
indicator = "autocorr_1"
operator = "<"
target = "-0.1"
timeframe = "1d"

Typical use: "Only run mean-reversion strategies when autocorrelation confirms reversion is real." Use this to gate fade-the-move entries. When autocorrelation is negative, buying dips and selling rips has a statistical edge.

cross_above -- Event-Based

What it does: Fires once, at the exact candle where autocorrelation transitions from below the threshold to above it. The previous candle had autocorrelation <= the target, and the current candle has autocorrelation > the target.

[[actions.triggers]]
indicator = "autocorr_1"
operator = "cross_above"
target = "0.1"
timeframe = "1d"

Typical use: Detect the moment the market shifts into a momentum regime. The market was random or mean-reverting and has just started exhibiting return persistence. This signals the beginning of a trend-friendly environment -- a good time to activate momentum strategies.

cross_below -- Event-Based

What it does: Fires once, at the exact candle where autocorrelation transitions from above the threshold to below it. The previous candle had autocorrelation >= the target, and the current candle has autocorrelation < the target.

[[actions.triggers]]
indicator = "autocorr_1"
operator = "cross_below"
target = "0"
timeframe = "1d"

Typical use: Detect the moment the market exits a momentum regime. Autocorrelation was positive (trending) and has dropped to zero or negative -- momentum is dying. This is an exit signal for trend-following positions, warning that the directional persistence that justified your trade is gone.

Why: Autocorrelation produces floating-point values calculated to many decimal places. Exact equality will almost never be true. Use > or < instead.

Choosing the right operator

  • Use > to validate momentum strategies -- "only trade trends when autocorrelation confirms persistence." This is the most common operator.
  • Use < to validate mean-reversion strategies -- "only fade moves when autocorrelation confirms reversion."
  • Use cross_above / cross_below to detect regime transitions -- the exact moment the market shifts between momentum and mean-reversion.

TOML Examples

Momentum Validated Entry

Only enter a momentum trade when autocorrelation confirms that returns are persisting AND ROC shows positive momentum. This prevents trading momentum in random-walk markets where trend strategies bleed to death from noise.

[[actions]]
type = "open_long"
amount = "100 USDC"

  [[actions.triggers]]
  indicator = "autocorr_1"
  operator = ">"
  target = "0.1"
  timeframe = "1d"

  [[actions.triggers]]
  indicator = "roc_10"
  operator = ">"
  target = "3"
  timeframe = "1d"

Mean Reversion Validated Dip Buy

Fade a sharp dip only when autocorrelation confirms the market is in a mean-reverting regime. When autocorrelation is negative, oversold conditions are more likely to reverse rather than continue lower.

[[actions]]
type = "open_long"
amount = "100 USDC"

  [[actions.triggers]]
  indicator = "autocorr_1"
  operator = "<"
  target = "-0.1"
  timeframe = "1d"

  [[actions.triggers]]
  indicator = "rsi_14"
  operator = "<"
  target = "30"
  timeframe = "4h"

Exit on Regime Change

Exit a trending position when autocorrelation drops below -0.05, signaling that momentum is ending and the market may be shifting to mean-reversion. This exits before a full reversal rather than waiting for price-based stop losses.

[[actions]]
type = "sell"
amount = "100%"

  [[actions.triggers]]
  indicator = "autocorr_1"
  operator = "cross_below"
  target = "-0.05"
  timeframe = "1d"

Multi-Lag Momentum Confirmation

Require positive autocorrelation at both lag 1 and lag 5. When momentum is present at multiple horizons, the trend is structurally stronger and more likely to persist. A single-lag signal can be noise; multi-lag agreement is conviction.

[[actions]]
type = "open_long"
amount = "100 USDC"

  [[actions.triggers]]
  indicator = "autocorr_1"
  operator = ">"
  target = "0.1"
  timeframe = "1d"

  [[actions.triggers]]
  indicator = "autocorr_5"
  operator = ">"
  target = "0.1"
  timeframe = "1d"

  [[actions.triggers]]
  indicator = "roc_10"
  operator = ">"
  target = "2"
  timeframe = "1d"

Combined with Hurst for Double Confirmation

Use Hurst exponent for long-term regime classification and autocorrelation for short-term persistence confirmation. Hurst > 0.55 says the market is structurally trending. Autocorrelation > 0.1 says returns are currently persisting. Both together give the highest-confidence momentum signal.

[[actions]]
type = "open_long"
amount = "100 USDC"

  [[actions.triggers]]
  indicator = "hurst"
  operator = ">"
  target = "0.55"
  timeframe = "1d"

  [[actions.triggers]]
  indicator = "autocorr_1"
  operator = ">"
  target = "0.1"
  timeframe = "1d"

  [[actions.triggers]]
  indicator = "ema_20"
  operator = ">"
  target = "ema_50"
  timeframe = "1d"

Tips

THE filter for momentum strategies

Before running any momentum, trend-following, or breakout strategy, check autocorrelation first. If autocorr_1 is near zero or negative, your momentum strategy has no statistical edge -- it is trading noise. This single filter can prevent months of slow losses from running trend strategies in a trendless market. Gate every momentum entry behind autocorr_1 > 0.1 as a minimum.

Use lag 1 for most cases, check higher lags for confirmation

Lag 1 is the most important -- it captures the immediate one-step persistence that most short-term strategies exploit. Lag 5 and lag 10 reveal whether momentum extends to longer horizons. When autocorr_1, autocorr_5, and autocorr_10 are all positive, you have momentum at every scale -- a structurally strong trend. When only lag 1 is positive but lag 5 is near zero, momentum is short-lived and your holding period should be short.

Combine with Hurst for the full regime picture

Hurst exponent and autocorrelation are complementary. Hurst measures the long-term memory structure of the price series (is the market fundamentally trending or mean-reverting?). Autocorrelation measures the short-term persistence of returns (are current moves continuing?). Hurst is slow-moving and stable; autocorrelation is responsive and fast. Use Hurst for strategy selection and autocorrelation for entry timing.

Crypto momentum is short-lived

Academic research consistently shows that momentum in cryptocurrency markets is SHORT-LIVED compared to equities. For altcoins, momentum effects typically last 1--4 weeks before reversing. BTC has somewhat longer momentum persistence. This means: (1) use daily or 4-hour timeframes for reliable autocorrelation signals, (2) do not assume momentum will last indefinitely, and (3) always have an exit trigger based on autocorrelation declining -- when autocorr_1 drops toward zero, the momentum window is closing.

Values between -0.1 and 0.1 are noise

The statistical significance threshold for a 100-candle window is approximately |autocorrelation| > 0.2. Values between -0.1 and 0.1 are almost certainly random noise -- do not build strategies around them. Values between 0.1 and 0.2 are suggestive but not conclusive. Only values beyond 0.2 give you high confidence that the serial dependence is real and exploitable.