Percentage Price Oscillator (PPO)
The gap between a fast and a slow moving average, as a percentage of the slow one.
What it measures
Section titled “What it measures”PPO is MACD divided by the slow EMA, so a reading means the same on any instrument at any price level. With signalEMAPeriods, it adds a signal line and a histogram.
How traders read it
Section titled “How traders read it”Traders read it as they read MACD: crossings of the signal line and of zero. Because it is a percentage, it can also compare momentum between instruments.
Formula
Section titled “Formula”PPO = (EMA(fast) − EMA(slow)) / EMA(slow) × 100signal = EMA(PPO, signalEMAPeriods)histogram = PPO − signalSettings and output
Section titled “Settings and output”Call: ppo(fastEMAPeriods, slowEMAPeriods, signalEMAPeriods)
| Setting | Chart default |
|---|---|
fastEMAPeriods: Fast EMA Periods |
12 |
slowEMAPeriods: Slow EMA Periods |
26 |
signalEMAPeriods: Signal EMA Periods |
9 |
What you get: a list of 3, in this order: 1. a number (“Price Percentage Oscillator Histogram”); 2. a number (“Price Percentage Oscillator Signal”); 3. a number (“Price Percentage Oscillator”).
Warm-up: with ppo(12, 26, 9), it asks for 26 bars of history and a run-up of 61, and its first value came on bar 35 of the example data.
The prices are made up, hourly, and the same on every page, so the chart shows how the indicator behaves, not how a market behaved.
In an algorithm
Section titled “In an algorithm”function onIntervalClose() { const lines = ppo(12, 26, 9); const histogram = lines[0]; const signal = lines[1]; const value = lines[2]; if (OPEN_POSITIONS_COUNT === 0 && histogram > 0 && value > 0) { openPosition("BUY", { quantity: 10000, stopLossPips: 25, takeProfitPips: 50 }); } log("PPO", value, "signal", signal);}With a signal, the order is histogram, signal, PPO: the reverse of MACD’s order. Without signalEMAPeriods, ppo(12, 26) gives a single number.