j1O9SB

Keltner Channels Oscillator v2

A cleaner aesthetic and an introduction to the indicator's uses.
I would also be very appreciative of any Keltner Channels related ideas or concepts you may have run across to add features to this indicator.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
study(title="Keltner Channels Oscillator",shorttitle="KCO",overlay=false,precision=1)
//Inputs
kc_len=input(21,title="Keltner Channel Length")
kc_mult1=input(1,title="Keltner Channel First Multiple")
kc_mult2=input(2,title="Keltner Channel Second Multiple")
kc_src=input(close,title="Keltner Channel Source")
//Keltner Channel
kc_ma=ema(kc_src,kc_len)
kc_rng=ema(tr,kc_len)
kc_oneup=kc_ma+kc_rng*kc_mult1
kc_onedn=kc_ma-kc_rng*kc_mult1
kc_twoup=kc_ma+kc_rng*kc_mult2
kc_twodn=kc_ma-kc_rng*kc_mult2
//Oscillator
kc_lvlclose=(close-kc_ma)/kc_rng
kc_lvlopen=(open-kc_ma)/kc_rng
kc_lvlhigh=(high-kc_ma)/kc_rng
kc_lvllow=(low-kc_ma)/kc_rng
kc_lvloneup=(kc_oneup-kc_ma)/kc_rng
kc_lvlonedn=(kc_onedn-kc_ma)/kc_rng
kc_lvltwoup=(kc_twoup-kc_ma)/kc_rng
kc_lvltwodn=(kc_twodn-kc_ma)/kc_rng
//Color
kc_col=kc_lvlclose>0?green:red
kc_colbar=(close>open)?white:black
//Plots
plotbar(kc_lvlopen,kc_lvlhigh,kc_lvllow,kc_lvlclose,color=kc_colbar,editable=true)
plot(0,color=gray,style=line,linewidth=1,editable=false)
plot(2,color=white,style=line,linewidth=1,editable=false)
plot(1,color=white,style=line,linewidth=1,editable=false)
plot(-1,color=black,style=line,linewidth=1,editable=false)
plot(-2,color=black,style=line,linewidth=1,editable=false)