Obv ma cross up event
Flags each minute that On-Balance Volume rises through its own moving average, about 49 times a day on SPY.
On-Balance Volume (OBV) is a running total: each bar adds its volume when the close is above the previous close and subtracts it when the close is below. The rule averages that total, with an exponential average by default or a plain average when ema is off, and marks each bar where the total moves from at or below that average to above it. The total starts at zero on the first loaded bar, so only its direction and its position against the average carry meaning, not its level.
How to read it
- Markers sit on the candles, one per bar where the cross happens. Each is a single-bar event, so it marks a moment, not a state.
- A marker means net volume flow has turned up: recent up-closes added enough volume to lift the total above its average.
- Clusters of markers in a choppy stretch are mostly noise, because the total wobbles around its average and crosses back and forth.
What it outputs
- OBV crosses above its average
- A marker on each bar where OBV moves from at or below its moving average to above it. Each marker is a single bar.
When it fires
On the bar the total moves from at or below its average to above it. It means net volume flow has turned up: recent up-closes added enough volume to lift the total past its average. It is a turn in volume flow, not a price breakout.
Settings
- ma_window
- Bars in the average that OBV is compared against. Shorter tracks every wiggle of the volume total and crosses often. Longer lags behind and crosses less, with later signals.
- ema
- On uses an exponential average that weights recent bars more, so it reacts faster. Off uses a plain average of the last ma_window bars, with every bar weighted equally, so it reacts more slowly.
Pitfalls
- The total starts at zero on the first loaded bar, so its level depends on how far back the data reaches. Compare crossings, never the absolute number.
- With defaults it fires about 49 times a day on SPY one-minute bars, roughly 5% of bars in a one-month sample. Most markers are noise without a trend or price filter.
- A marker is one bar. The total can slip back below its average on the next bar, so one marker is not a confirmed move.