Order Flow Autocorrelation
Quick Reference
| Property | Value |
|---|---|
| Dimension | stability |
| Category | order_flow |
| Version | v0.9.0 (Beta) |
| Output Column | ofi_autocorrelation |
Order flow autocorrelation: corr(ofi, prev(ofi, 1), window=20)
Formula
rolling_corr(ofi, lag(ofi, lag), window)
CDM Inputs
| Column | CDM Table | Description |
|---|---|---|
best_bid_size | cdm_* | CDM source table |
best_ask_size | cdm_* | CDM source table |
ofi | cdm_* | CDM source table |
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
window | integer [2, 200] | 20 | Window size for correlation calculation |
lag | integer [1, 50] | 1 | Lag for autocorrelation (e.g., 1 for correlation with previous value) |
Output
Column: ofi_autocorrelation
Autocorrelation of order flow imbalance with 1-period lag
Market Intuition & Trading Rationale
Order flow autocorrelation measures the persistence of OFI direction: corr(ofi[t], ofi[t-lag]). It answers: is the current order flow direction similar to recent flow? High positive autocorrelation means buying pressure tends to follow buying pressure — the flow is persistent and likely informed (an institution working a large order). Low or negative autocorrelation means flow flips direction frequently — noise trading or market-making activity.
This is the stability counterpart to flow_persistence_score (signal dimension). The signal feature captures the magnitude of persistence; this stability feature captures its reliability. A flow persistence score of 0.8 is impressive, but if the order_flow_autocorrelation is only 0.1, that persistence score is unreliable — it fluctuates too much to trade on.
Usage Cases
- Informed flow confirmation: High OFI magnitude + high order_flow_autocorrelation = genuine informed flow. High OFI magnitude + low autocorrelation = noisy flow, possibly a single large order that won't persist.
- Execution program detection: Sustained positive autocorrelation (> 0.5) over multiple windows indicates an institutional algorithm is actively working an order. Join the direction; exit when autocorrelation drops.
- stability context: Foundational stability feature used across flow-based feature sets — every OFI-based signal has its autocorrelation measured to distinguish persistent from transient flow.
YAML Definition
name: order_flow_autocorrelation
description: 'Order flow autocorrelation: corr(ofi, prev(ofi, 1), window=20)'
category: order_flow
version: v0.9.0 (Beta)
dimension: stability
status: Pre-release
required_inputs:
- best_bid_size
- best_ask_size
- ofi
output_column: ofi_autocorrelation
output_description: Autocorrelation of order flow imbalance with 1-period lag
tags:
- autocorrelation
- ofi
- order_flow
- correlation
- time_series
- microstructure
parameters:
window:
type: integer
description: Window size for correlation calculation
required: false
default: 20
constraints:
min: 2
max: 200
lag:
type: integer
description: Lag for autocorrelation (e.g., 1 for correlation with previous value)
required: false
default: 1
constraints:
min: 1
max: 50
formula: rolling_corr(ofi, lag(ofi, lag), window)