Percentage Volume Oscillator (PVO)
Summary
Percentage Volume Oscillator: a variation of the Percentage Price Oscillator (PPO, created by Gerald Appel) applied to the volume series instead of price. It is the difference between a fast and slow moving average of volume, expressed as a percentage of the slow MA. Positive when short-term volume is above its longer-term average (rising participation), negative when below. The default periods (12, 26) match MACD and PPO.
Chart
Chart metadata i
Outputs
outReal:line·zero·positive·negative
Formula
PVO = ((fastMA(inVolume) - slowMA(inVolume)) / slowMA(inVolume)) * 100, both MAs of type optInMAType; output = 0 when slowMA == 0
The standard form is exponential with periods 12 and 26 — ((12-day EMA of Volume - 26-day EMA of Volume) / 26-day EMA of Volume) * 100, i.e. the PPO/MACD oscillator computed on volume. optInMAType therefore defaults to EMA — the moving average Gerald Appel used for the original PPO/MACD; pass another type (e.g. TA_MAType_SMA) to override.
Notes
optInMATypeapplies to both the fast and slow moving average.TA_MAType_MAMAignores its period argument, so withoptInMAType = TA_MAType_MAMAthe fast and slow MAs are identical, making the numerator — and therefore the output — zero at every bar.- If the slow period is set smaller than the fast period, the two are swapped, as in
MACD.
Inputs
inVolume— Volume of each bar
Outputs
outReal— PVO value in percent
Parameters
| Parameter | Type | Default | Accepted values | Description |
|---|---|---|---|---|
optInFastPeriod | integer | 12 | 2–100000 | Period of the fast MA |
optInSlowPeriod | integer | 26 | 2–100000 | Period of the slow MA |
optInMAType | MAType | EMA (1) | any MAType | Moving average type used for both MAs |
MAType values: 0 SMA · 1 EMA · 2 WMA · 3 DEMA · 4 TEMA · 5 TRIMA · 6 KAMA · 7 MAMA · 8 T3 · 9 HMA · 10 DISABLED · 11 DEFAULT · 12 ZLEMA · 13 RMA · 14 VIDYA · 15 ALMA
Properties
Numerical Stability: Depends on MA Type — This function's default, EMA, has an initial unstable period.
| ☐ Overlap Input |
| ✅ Independent Y-Axis i |
| ☐ Candlestick |
| ☐ Display Shift |
| ☐ Can Output NaN or ±Inf |
| ☐ Identity at Period 1 |
| ☐ Uses Transcendental |
| ☐ Input Must Be Positive |
Example
#include <stdio.h>
#include <ta_libc.h>
int n = 252;
double volume[252]; /* your data, oldest first */
double out[252];
int outBegIdx, outNBElement;
TA_Initialize();
TA_PVO( 0, n - 1, volume, 12, 26, TA_MAType_EMA, &outBegIdx, &outNBElement, out );
printf( "%d values from bar %d: [%.4f, ..., %.4f]\n", outNBElement, outBegIdx, out[0], out[outNBElement - 1] );use ta_lib::{Core, MAType};
let volume = vec![0.0; 252]; // your data, oldest first
let mut out = vec![0.0; 252];
let core = Core::new();
let range = core.pvo(0, volume.len() - 1, &volume, 12, 26, MAType::EMA, &mut out)?;
println!("{} values from bar {}: [{:.4}, ..., {:.4}]", range.count, range.beg_idx, out[0], out[range.count - 1]);import io.github.talib.Core;
import io.github.talib.MAType;
import io.github.talib.OutRange;
import java.util.Locale;
double[] volume = new double[252]; // your data, oldest first
double[] out = new double[252];
Core core = Core.DEFAULT;
OutRange r = core.pvo(0, volume.length - 1, volume, 12, 26, MAType.EMA, out);
System.out.printf(Locale.ROOT, "%d values from bar %d: [%.4f, ..., %.4f]%n", r.count(), r.begIdx(), out[0], out[r.count() - 1]);using System;
using TALib;
var volume = new double[252]; // your data, oldest first
var outReal = new double[252];
var core = Core.Default;
OutRange r = core.Pvo(0, volume.Length - 1, volume, 12, 26, MAType.EMA, outReal);
Console.WriteLine(FormattableString.Invariant($"{r.Count} values from bar {r.BegIdx}: [{outReal[0]:F4}, ..., {outReal[r.Count - 1]:F4}]"));import { MAType, pvo } from 'ta-lib';
const volume = new Float64Array(252); // your data, oldest first
const { begIdx, values } = pvo({ volume }, {
fastPeriod: 12,
slowPeriod: 26,
maType: MAType.EMA,
});
console.log(values.length + ' values from bar ' + begIdx + ': [' + values[0].toFixed(4) + ', ..., ' + values[values.length - 1].toFixed(4) + ']');import (
"fmt"
"log"
talib "ta-lib.github.io/go"
)
volume := make([]float64, 252) // your data, oldest first
out := make([]float64, 252)
core := talib.NewCore()
r, err := core.PVO(0, len(volume)-1, volume, 12, 26, talib.MATypeEMA, out)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%d values from bar %d: [%.4f, ..., %.4f]\n", r.NBElement, r.BegIdx, out[0], out[r.NBElement-1])Implementation
Added in 0.8.1 (ta-lib-python 0.8.1).
TA-Lib Definition: pvo.c · pvo.yaml
| Native | File |
|---|---|
| C | ta_PVO.c |
| Rust | pvo.rs |
| Java | Core_PVO.java |
| C# | Core_PVO.cs |
| TypeScript | pvo.ts |
| Go | pvo.go |
Python: talib.PVO (ta-lib-python 0.8.1 or later), see ta-lib-python.
TA-Lib is also available for R and more using a wrapper.
Aliases
Percentage Volume Oscillator
See Also
References
- PVO has no separately documented originator; it applies the PPO/MACD oscillator (Gerald Appel) to the volume series.
- Formula and standard (12, 26, 9) parameters: Percentage Volume Oscillator (PVO), StockCharts ChartSchool; also documented by TradingView.