Autocorrelation Pass Node
Autocorrelation — Series Input
Overview
Measures the serial correlation of any upstream numeric series at a user-defined lag. A value near +1 means the series tends to continue in the same direction; near -1 means it reverses; near 0 means no linear relationship between consecutive values.
Unlike the base Autocorrelation node which reads closing prices from a root stock node, this Pass variant accepts any { values, timestamps } input — making it applicable to indicator outputs, spreads, or custom signals.
Formula
period bars, then stepped forward one bar at a time. Output range: −1 to +1.Parameters
| Parameter | Default | Description |
|---|---|---|
| period | 20 | Rolling lookback window size in bars |
| lag | 1 | Number of bars back to correlate against |
Inputs & Outputs
| Slot | Direction | Type | Description |
|---|---|---|---|
| input | Input | { values, timestamps } | Any upstream numeric series |
| values | Output | (number | null)[] | Autocorrelation values (−1 to +1); nulls during warm-up |
| timestamps | Output | number[] | Unix timestamps aligned to input |
Use Cases
Mean Reversion Detection
Negative lag-1 autocorrelation signals mean-reverting behaviour — use as a filter before applying mean-reversion strategies.
Trend Confirmation
High positive autocorrelation (≥ 0.7) suggests a persistent trend; combine with a momentum indicator for entry.
ML Feature Engineering
Feed autocorrelation at multiple lags as features into a machine-learning model to capture temporal structure.
Tips & Best Practices
Lag=1 Most Common
Lag-1 captures the strongest serial dependence. Increase lag to study longer-range dependence patterns.
Warm-up = period + lag
The first period + lag bars will be null. Ensure sufficient historical data.
Normalise Before Using
Apply Z-Score Pass to autocorrelation output to get a signal normalised for current regime.