APO
APO
Summary
Absolute Price Oscillator: the difference between a fast and a slow moving average of the input, in price units. Measures short- vs long-term momentum. Positive when fast MA > slow MA (upward momentum); negative otherwise.
Formula
, both MAs of type optInMAType
The standard form is exponential — APO with EMA and periods 12/26 is the fast-minus-slow EMA construction underlying the MACD (in price units). optInMAType therefore defaults to EMA — the moving average Gerald Appel used for the original MACD; pass another type (e.g. TA_MAType_SMA) to override.
Inputs
inReal— Source data series
Outputs
outReal— Fast MA minus slow MA
Parameters
| Parameter | Type | Default | Accepted values | Description |
|---|---|---|---|---|
optInFastPeriod | integer | 12 | 2–100000 | Period of the fast moving average |
optInSlowPeriod | integer | 26 | 2–100000 | Period of the slow moving average |
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: apo.c · apo.yaml
| Native | File |
|---|---|
| C | ta_APO.c |
| Rust | apo.rs |
| Java | Core_APO.java |
TA-Lib is also available for Python, R and more using a wrapper.
Aliases
Absolute Price Oscillator
See Also
References
- Gerald Appel, creator of the MACD (introduced 1979 in his Systems and Forecasts newsletter). The APO is the same fast-minus-slow moving-average oscillator in price units; with exponential moving averages and periods 12/26 it is the oscillator underlying the MACD line. Appel's original definition uses exponential moving averages.