PPO
PPO
Summary
Percentage Price Oscillator: the difference between a fast and slow moving average expressed as a percentage of the slow MA. A normalized (scale-invariant) variant of APO. Positive when the fast MA is above the slow MA (upward momentum), negative otherwise; magnitude is the % deviation.
Formula
PPO = ((fastMA(inReal) - slowMA(inReal)) / slowMA(inReal)) * 100, both MAs of type optInMAType; output = 0 when slowMA == 0
The standard form is exponential with periods 12 and 26 — ((12-day EMA - 26-day EMA) / 26-day EMA) * 100, i.e. the MACD oscillator expressed as a percentage. 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.
Inputs
inReal— Input data series
Outputs
outReal— PPO 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
Properties
Numerical Stability: Depends on MA Type — This function's default, EMA, has an initial unstable period.
| Display Flags |
|---|
| ☐ Overlap Input |
| ✅ Independent Y-Axis i |
| ☐ Candlestick |
Implementation
TA-Lib Definition: ppo.c · ppo.yaml
| Native | File |
|---|---|
| C | ta_PPO.c |
| Rust | ppo.rs |
| Java | Core_PPO.java |
TA-Lib is also available for Python, R and more using a wrapper.
Aliases
Percentage Price Oscillator
See Also
References
- Gerald Appel, creator of the PPO and MACD (MACD introduced 1979 in his Systems and Forecasts newsletter). The PPO is the MACD expressed as a percentage of the slow moving average. Appel's original definition uses exponential moving averages (periods 12, 26).