What is CVD / OFI?
While ordinary volume is directionless, Volume Delta splits volume by aggressor side: market buys (a taker lifting the ask) count positive, market sells negative.
delta = aggressive_buy_volume − aggressive_sell_volume
CVD = running sum of delta # Cumulative Volume Delta
OFI = signed_volume / total_volume # Order Flow Imbalance ∈ [−1, +1] over a window
CVD shows the trend of order flow, OFI the momentary dominance of one side.
Why useful
- Confirmation: price rises and CVD rises → genuine buyer aggression is carrying the move.
- Divergence: price rises, CVD falls → rally without taker buys (often passive limit walls) → bull-trap risk (cf. Divergenz).
How Botty uses CVD
Loaded from backtesting/data/cvd_features_1m.parquet via data/cvd_data.py. Two filters (strategies/conditions/filters.py):
- cvd_align_filter: blocks longs when the 4h OFI is clearly negative (sellers dominant), and vice versa.
- cvd_divergence_filter: blocks when corr(log_ret, signed_vol) over 4h has the "wrong" sign for the trade direction (trap protection).
Limits
❌ The aggressor classification is only approximated on many spot/perp feeds (tick rule). ❌ Cumulative CVD has no absolute zero point — it counts the change, not the level.