DFA Pass Node
Detrended Fluctuation Analysis — Series Input
Overview
Detrended Fluctuation Analysis (DFA) quantifies the long-range correlation structure of a time series by computing a scaling exponent α. It avoids spurious correlations from non-stationarity by detrending integrated series in windows before measuring fluctuations.
The DFA exponent α is related to but distinct from the Hurst exponent and provides a complementary view of fractal market structure.
Formula
Parameters
| Parameter | Default | Description |
|---|---|---|
| period | 30 | Rolling window in bars. Larger values give more reliable scaling estimates. |
Inputs & Outputs
| Slot | Direction | Type | Description |
|---|---|---|---|
| input | Input | { values, timestamps } | Any upstream numeric series |
| values | Output | (number | null)[] | DFA scaling exponent α per bar; nulls during warm-up |
| timestamps | Output | number[] | Unix timestamps aligned to input |
Use Cases
Market Regime Detection
Switch between trending and mean-reversion strategies based on whether α is above or below 0.5.
Complement to Hurst Exponent
DFA handles non-stationary series more robustly than R/S analysis (Hurst). Use both for confirmation.
Trend Filter
Only enter trend-following trades when α > 0.6, filtering out choppy, random-walk conditions.
Tips & Best Practices
Use Larger Windows
DFA requires multiple sub-windows. A period of at least 30 bars is recommended; 50–100 is better for reliable estimates.
Log Returns as Input
Feed log returns for a more stationary input that produces cleaner DFA scaling estimates.
Compare to Hurst
DFA α and Hurst H should agree directionally. Divergence may indicate non-stationarity in the data.