Absolute price oscillator
All indicators

LibraryMomentum

Indicator

Absolute price oscillator

The gap between a fast and a slow exponential average of price, in price units: the MACD line without its signal.

MomentumOwn pane3 inputsAPO

How it is calculated

APO is EMA(fast) minus EMA(slow) of the source. Each EMA is seeded with the plain mean of its own first values, so APO equals the macd line with the same lengths, value for value. TA-Lib APO seeds the fast average later so both start on the same bar; the values agree once that seed has decayed.

Reference: TA-Lib APO with EMA

How to read it

Above zero the fast average is over the slow one and the short term trend points up; below zero it points down. A zero crossing is the crossing of the two averages. In price units, so not comparable between markets; PPO is for that. It lags and whipsaws in a sideways market.

In a strategy

A crossing of two averages as one number: when ctx.ind("apo", fast=12, slow=26) turns from below zero to above, the fast EMA has crossed over the slow one, a common trend entry.

Inputs

InputTypeDefaultRange or choices
Fast lengthfastWhole number12min 1, max 5000
Slow lengthslowWhole number26min 1, max 5000
SourcesourcePrice"close"close, open, high, low, hl2, hlc3, ohlc4, hlcc4

What it draws

LineDrawn as
APOLine

Guide lines at 0.

Used in

No strategy template reads it yet.

OrionQuant