Percentage Price Oscillator
"Percentage Price Oscillator" by everget, MIT. Ported to FloScript by FloSignals; modifications under MPL-2.0. Original: Percentage Price Oscillator (v4.0), read 2026-10-12T15:49:33.484Z; source language v3.
Licence: MIT License (MIT) — full text.
Percentage Price Oscillator by everget, ported from Pine v3. Pane indicator with 3 plots, 2 marker series, 1 fill, 1 level, bar/background colouring and 8 inputs.
// Copyright (c) 2018-present, Alex Orekhov (everget)
// Percentage Price Oscillator script may be freely distributed under the MIT license.
// ------------------------------------------------------------------------------------------------
// Original author: everget
// Original title: Percentage Price Oscillator
// Licence: MIT (the header above is the original notice, kept verbatim)
// Pine version: 3
// Fetched: 2026-10-12
// Ported to FloScript by FloSignals; modifications under MPL-2.0.
// Converter: @flosignals/floscript 0.1.0, strict mode, score 100/100
// ------------------------------------------------------------------------------------------------
//@floscript=1
//@version=5
// Converted by the FloScript converter from a Pine-compatible v3 source.
indicator("Percentage Price Oscillator", shorttitle="PPO")
fastLength = input.int(title="Fast Length", defval=12)
slowLength = input.int(title="Slow Length", defval=26)
signalLength = input.int(title="Signal Length", defval=9)
src = input.source(title="Source", defval=close)
showHistogram = input.bool(title="Show Histogram ?", defval=true)
highlightCrossovers = input.bool(title="Highlight PPO/Signal Crossovers ?", defval=true)
highlightZeroCrossovers = input.bool(title="Highlight Zero Line Crossovers ?", defval=false)
applyFilling = input.bool(title="Apply Ribbon Filling ?", defval=false)
ppo = 100 * (ta.ema(src, fastLength) - ta.ema(src, slowLength)) / ta.ema(src, slowLength)
signal = ta.ema(ppo, signalLength)
hist = ppo - signal
histColor = hist >= 0 ? (hist[1] < hist ? #26A69A : #B2DFDB) : hist[1] < hist ? #FFCDD2 : #EF5350
plot(showHistogram ? hist : na, title="Histogram", style=plot.style_columns, color=color.new(histColor, 0))
hline(0, title="Zero Line", linestyle=hline.style_dotted)
trendColor = ppo > signal ? #0ebb23 : color.red
ppoColor = applyFilling ? trendColor : #0094ff
signalColor = applyFilling ? trendColor : #ff6a00
ppoPlot = plot(ppo, title="PPO", color=color.new(ppoColor, 0))
signalPlot = plot(signal, title="Signal", color=color.new(signalColor, 0))
transparent = color.new(color.white, 100)
fillColor = applyFilling ? trendColor : transparent
fill(ppoPlot, signalPlot, color=color.new(fillColor, 70))
zeroCrossBgColor = highlightZeroCrossovers ? (ppo > 0 ? color.green : color.red) : transparent
bgcolor(color.new(zeroCrossBgColor, 90))
plotshape(highlightCrossovers and ta.crossover(ppo, signal) ? ppo : na, title="Crossover", location=location.absolute, style=shape.circle, size=size.tiny, color=color.new(color.green, 0))
plotshape(highlightCrossovers and ta.crossunder(ppo, signal) ? ppo : na, title="Crossunder", location=location.absolute, style=shape.circle, size=size.tiny, color=color.new(color.red, 0))
This file is under the MIT License; it is a port of the original by everget, with the original licence header kept and the changes made for FloScript noted in the file.
- v2
Library refresh 2026-10-14
- v1
Library refresh 2026-10-12
Disclaimer. Scripts are written and published by members, or ported by FloSignals from open-source originals, and are their authors' own work and opinion. FloSignals does not review them for correctness and nothing in a script is financial advice or a recommendation to buy or sell anything — read the Risk Disclaimer. Posting here is under the Community Rules; a script that is not the poster's to post can be reported as the Copyright & Takedowns page says.

Comments (0)
No comments yet. Members can leave one.