Volume is the conviction behind a move#
Price says what happened. Volume says how many participants agreed. A breakout on triple the usual volume and the same breakout on a sleepy afternoon are different events, even though the price change is identical. Thin moves reverse easily because few holders committed to them. Heavy moves carry more information, in both directions.
Pyx ships two volume indicators, Volume MA and On-Balance Volume, plus rolling correlation, which is not a volume tool but belongs in the same conversation: it measures whether two things move together, which is what diversification quietly depends on.
Volume moving average#
The Volume MA is a simple moving average computed on share volume instead of price.
Twenty bars is roughly a month of trading, so the line is a baseline for what normal participation currently looks like. The reading is always a ratio: today's bar against the line. Volume at twice the average on a breakout day is genuine participation. Volume at half the average on the same price move suggests a thin advance that fewer people will defend.
Persistent patterns matter more than single bars. Advances on above-average volume with declines on below-average volume describe accumulation. The reverse pattern describes distribution.
One earnings day can quadruple volume and inflate the average for the next 20 bars. After a spike, the baseline itself is distorted for a while.
On-Balance Volume (OBV)#
OBV, introduced by Joseph Granville in 1963, keeps a running total of volume signed by price direction. Up day: add the volume. Down day: subtract it. Flat day: no change.
The premise is that volume flow shifts before price does. When a stock is being quietly accumulated, up days tend to carry heavier volume than down days, and OBV trends higher even while price chops sideways.
Two honest limits. The absolute OBV number is meaningless: it depends entirely on where the loaded data happens to start. Only the slope and the pattern of highs and lows carry information. And the rule is binary: a bar that closes up one cent adds exactly as much volume as a bar that closes up ten percent, so magnitude is thrown away.
The canonical read is divergence. Price prints a new high, OBV does not: the rally is running on thinner participation, a warning. Price prints a new low while OBV holds above its prior low: selling pressure is drying up. OBV breaking its own trendline before price breaks its own is the classic volume-leads-price observation. Like all divergences, these describe fading force, not timing.
What correlation measures#
Correlation is a number between -1 and +1 describing how tightly two series move together. At +1 they move in lockstep. At -1 they move exactly opposite. Near 0, knowing one tells you nothing about the other.
This is the arithmetic behind diversification. Owning ten holdings that all correlate at +0.9 is close to owning one holding at ten times the size. The risk reduction you get from spreading money around comes almost entirely from the correlations being less than one, not from the count of tickers. That argument runs through the diversification guide.
Rolling correlation in Pyx#
A single correlation number for two stocks hides the fact that the relationship changes. Rolling correlation recomputes it inside a moving window, producing a time series of the relationship itself.
Pyx computes the Pearson correlation on the raw closes inside each 30-bar window, clamps rounding spill to the [-1, 1] range, and leaves the value blank when either series is flat over the window, since correlation is undefined for a constant series. You pick the comparison symbol when adding the indicator in the chart workspace.
How to read it: level and stability. A pair parked at +0.9 for months is functionally a single position. A pair that swings between +0.6 and -0.2 has no stable relationship, and any hedge built on the average of those numbers is fragile. The loudest signal the indicator gives is a regime break, a previously reliable relationship crossing zero.
Two honesty notes. First, correlation computed on raw prices reads higher than correlation computed on returns, because two series that both drift upward will look related even when their day-to-day moves are not. Treat high readings on long windows with some suspicion. Second, correlations between risky assets tend to rise toward +1 in crashes, exactly when you were counting on them to stay low. Diversification measured in calm markets overstates the protection available in a storm.
Using volume and correlation together#
Volume tools qualify moves in a single holding: was that breakout real, is this rally quietly emptying out. Correlation qualifies the portfolio: are these positions actually different bets. Neither predicts anything. Both replace a hunch with a measurement, and the measurement is frequently the opposite of the hunch.
Where to go next#
See how allocation and lookthrough expose overlap you did not know you had in diversification, sector exposure, and drift, or review the volatility toolkit in Bollinger Bands, ATR, and drawdown.