Infiten's Price Percentage Oscillator Channel (PPOC Indicator)
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © spiritualhealer117

//@version=4
study("PPO Display")
len1 = input(title="Short MA Length", type=input.integer, defval=14)
len2 = input(title="Long MA Length", type=input.integer, defval=14)
thresh = input(title="PPO Threshold", type=input.float, defval=0.3)

smas=sma(close,len1)
smal=sma(close,len2)
PPO = (smas-smal)/smal

low_forecast = -thresh*smal+smal
high_forecast = thresh*smal+smal

plot(low_forecast, title="Low PPO Thresh", color=color.red, style=plot.style_circles)
plot(high_forecast, title="High PPO Thresh", color=color.green, style=plot.style_circles)
plotcandle(smas, high_forecast, low_forecast, smal, title = 'MA PPO', color = smas<smal ? color.red : color.green, wickcolor = color.black)
plot(smas, title="Short SMA", color=color.white)
plot(smal, title="Long SMA", color=color.gray)