Percent Range
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © gulls

//@version=5
indicator("Percent Range",timeframe = '')
length = input.int(5, minval=1, title = 'EMA')
PercentB = ((close-open)/(high[1]-low[1]))*(close/low)
BEMA = ta.ema(PercentB,5)
ema12 = ta.ema(BEMA, length)
ema22 = ta.ema(ema12, length)
ema32 = ta.ema(ema22, length)
out2 = 3 * (ema12 - ema22) + ema32
plot(out2, "Range", color=color.green)
A = ta.highest(high,5)
B = ta.lowest(low,5)
C = (close-B)/(A-B)
plot(ta.vwma(C,5)-0.50,color=color.yellow)
hline(0)
hline(0,color=color.white)
hline(0.1,color=color.white)
hline(-0.1,color=color.white)
hline(0.2,color=color.green)
hline(-0.2,color=color.red)
hline(0.3,color=color.green)
hline(-0.3,color=color.red)
hline(.6,color=color.blue)
hline(.5,color=color.blue)
hline(.4,color=color.blue)
hline(-.6,color=color.blue)
hline(-.5,color=color.blue)
hline(-.4,color=color.blue)