VolumeOscillator
VolumeOscillator in ProBuilder returns the percentage difference between short and long moving averages of volume, gauging activity shifts. With examples.
Syntax
VolumeOscillator[S, L]Parameters
| Name | Type | Default | Description |
|---|---|---|---|
S | integer | none | Period of the short-term volume moving average. Must be smaller than L. A common setting is 5. |
L | integer | none | Period of the long-term volume moving average. A common setting is 10 or 20. |
The function takes no price argument, it is computed from the instrument's volume series.
Formula
VolumeOscillator = 100 * (shortAvg - longAvg) / longAvg
where shortAvg = moving average of volume over S bars
longAvg = moving average of volume over L barsThe output is the spread between the two volume averages expressed as a percentage of the long average, so readings are comparable across instruments regardless of their absolute volume levels.
How it works
Volume tends to expand when a market attracts interest and contract when it is ignored. The Volume Oscillator captures this by comparing a fast picture of activity, the short average, with a slower baseline, the long average. When recent bars trade more volume than the longer-term norm, the short average rises above the long one and the oscillator turns positive. When activity fades, the oscillator turns negative.
The value carries no directional information about price, it only describes participation. Its analytical use comes from combining it with price action: a breakout or trend accompanied by a positive and rising oscillator has volume behind it, while the same price pattern on a negative oscillator is running on thin participation, which technical analysis traditions treat as less trustworthy.
Because the output is a percentage of the long average, a reading of 20 means short-term volume runs 20 percent above its baseline whether the instrument trades thousands or millions of units per bar.
Examples
Example 1, Volume oscillator panel (Indicator)
// Percentage spread between the 5 and 10 period volume averages
vo = VolumeOscillator[5, 10]
RETURN vo AS "Volume Oscillator"Plots the oscillator around its zero line. Positive readings flag bars where short-term activity exceeds the longer-term norm.
Example 2, Breakout confirmed by volume (ProBacktest)
// Only take the breakout when trading activity is above its baseline
vo = VolumeOscillator[5, 20]
IF NOT ONMARKET AND close CROSSES OVER Highest[20](close)[1] AND vo > 0 THEN
BUY 1 CONTRACT AT MARKET
ENDIF
IF ONMARKET AND close CROSSES UNDER Average[20](close) THEN
SELL AT MARKET
ENDIFThe system buys a 20-bar high breakout only when the volume oscillator is positive, so entries require expanding participation, and exits on a close under the 20-bar average.
Example 3, Activity surge scan (ProScreener)
vo = VolumeOscillator[5, 10]
SCREENER[vo > 20] (vo AS "Vol osc %")Returns instruments whose short-term volume runs more than 20 percent above the long-term average, surfacing markets with a sudden pickup in interest.
Interpretation
| Reading | Meaning |
|---|---|
| Above 0 | Short-term activity above the longer-term norm, participation expanding. |
| Below 0 | Activity below the norm, participation contracting. |
| Rising with rising price | Advance supported by volume, conventionally a sign of trend strength. |
| Falling while price rises | Advance on shrinking volume, conventionally a caution signal. |
The oscillator is a confirmation tool, not a standalone signal generator. Zero-line crosses simply mark when the two volume averages swap order; their significance depends entirely on what price is doing at the time. Sustained positive readings during a trend indicate ongoing participation, while volume spikes that appear as sharp isolated peaks often accompany climactic moves.
Common errors and gotchas
- No usable volume data. On instruments without exchange volume, including many spot forex and CFD feeds that report tick counts, the oscillator reflects data quality rather than participation. Check the volume series first.
- Parameter order. The short period comes first:
VolumeOscillator[5, 10]. Swapping the arguments flips the sign of every reading. - Reading it as a price signal. The oscillator says nothing about direction. A strongly positive value occurs in crashes as readily as in rallies; it must be paired with a price condition.
- Intraday volume seasonality. On intraday charts, volume regularly swells at the open and close of the session. The oscillator turns positive at those times every day, which a screener threshold should account for.
Related instructions
Volume, the raw traded volume series.VolumeROC, percentage change of volume over N bars.PriceOscillator, the same two-average construction applied to price.OBV, on balance volume, cumulative signed volume flow.PVT, price volume trend, volume weighted by percentage price change.ChaikinOsc, oscillator on the accumulation distribution line.MoneyFlowIndex, volume-weighted momentum oscillator bounded 0 to 100.AccumDistr, accumulation distribution line.
