Skip to content

Technical indicators

Percentage Price Oscillator (PPO)

The gap between a fast and a slow moving average, as a percentage of the slow one.

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.

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.

PPO = (EMA(fast) − EMA(slow)) / EMA(slow) × 100
signal = EMA(PPO, signalEMAPeriods)
histogram = PPO − signal

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.

Percentage Price Oscillator (PPO) drawn by its own code on example prices

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.

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.