Noon Barbari
S'inscrire
Tous les articles
conceptPublié ·Lecture de 7 min

VFI: LazyBear's Volume Flow Indicator, ported

VFI is a signed-volume accumulator with a price-noise floor and a volume-spike cap — a more honest cousin of OBV. Now ported, with a frank note on where it actually helps.

Sur cette page

What VFI is

The Volume Flow Indicator is a signed-volume accumulator. Each bar contributes its volume with a sign — positive when the typical price moved up enough to count as real flow, negative when it moved down — and the running sum is the VFI line. The two features that distinguish it from On-Balance Volume are a noise floor that ignores micro-moves and a spike cap that prevents a single explosive bar from drowning out the next 50 bars of normal flow.

LazyBear's TradingView script is the canonical Pine implementation. We re-implemented it from the public formula rather than translating any specific platform's code, ran the output against the Pine version on a 60-day BTC/USDT 1h sample, and the two curves agree to within floating-point rounding.

The math, briefly

VFI in five lines
typical   = (high + low + close) / 3
ret_log   = ln(typical / typical[1])              # log-return of typical price
cutoff    = coef * stdev(ret_log, period)         # noise floor (typical coef ≈ 0.2)
v_signed  = sign(ret_log) * min(volume, vol_cap)  # signed and capped by vol_cap
vfi_raw   = rolling_sum(v_signed where abs(ret_log) > cutoff, period)
vfi       = ema(vfi_raw, smooth_period) / avg_volume(period)
signal    = ema(vfi, signal_period)

Five knobs: period (the rolling window, typically 130), coef (noise-floor multiple of return stdev, typically 0.2), vol_cap (spike cap as a multiple of average volume, typically 2.5), smooth_period (3), and signal_period (9). The normalisation by average volume keeps the indicator comparable across instruments with very different absolute volumes.

Reading the chart

VFI oscillates around zero. A reading above zero says the recent net flow has been into the instrument — accumulation. A reading below zero says distribution. The signal line is a slower EMA of VFI; VFI crossing above its signal line is a momentum-up event, crossing below is momentum-down. Divergences — price making a new high while VFI fails to — are the same setup you'd read on RSI or MACD, just measured through volume rather than price.

The noise floor is the part most people don't appreciate. On a slow chop bar where typical price barely moves, OBV still credits the full volume to whichever side closed marginally higher. VFI ignores those bars entirely. That makes the line cleaner during low-conviction ranges and louder during real moves — which is precisely what a flow indicator should do.

Honest take

Essaie-le sur tes propres données

Chaque concept ci-dessus est implémenté dans la plateforme. Backtest, walk-forward, paper trading, puis passage en live — même jeu de règles à chaque étape.

Lectures associées