Open-source scriptindicator/v1
Percentage Price Oscillator
Compare fast and slow exponential price averages as a percentage of the slower average.
#momentum#oscillator#ppo
Description
The Percentage Price Oscillator normalizes the distance between two exponential moving averages by the slower average. Its signal line and histogram resemble MACD while making readings more comparable across different price levels.
Open-source script. Everyone can inspect the source code, use the script on a chart, and save an editable copy.
Release notes
Version history · 1 published version
Version 1CurrentChart updatedPercentage Price Oscillator · Aug 31, 2026
Source codempl-2.0View sourceHide source
indicator("Percentage Price Oscillator", { overlay: false });
const fastLength = input.int("Fast Length", 12, { min: 1, max: 200 });
const slowLength = input.int("Slow Length", 26, { min: 2, max: 500 });
const signalLength = input.int("Signal Length", 9, { min: 1, max: 200 });
const fast = ema(close, fastLength);
const slow = ema(close, slowLength);
const ppo = fast.map((v, i) => slow[i] === 0 ? 0 : 100 * (v - slow[i]) / slow[i]);
const signalLine = ema(ppo, signalLength);
const histogram = ppo.map((v, i) => v - signalLine[i]);
plot(histogram, { title: "Histogram", color: "#90a4ae", type: "histogram" });
plot(ppo, { title: "PPO", color: "#2962ff", lineWidth: 2 });
plot(signalLine, { title: "Signal", color: "#ff6d00" });
hline(0, { title: "Zero", color: "#78909c", style: "dotted" });
Community discussion
0 comments
No comments yet. Start the discussion.