j1O9SB

Keltner Channels Oscillator

Keltner Channels Oscillator
Please post ideas/improvements for a v2.
Remove from Favorite Scripts Add to Favorite Scripts
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=((kc_lvlclose>kc_lvlonedn)and(kc_lvllow<kc_lvlonedn))?green:((kc_lvlclose<kc_lvloneup)and(kc_lvlhigh>kc_lvloneup))?red:(close>open)?white:black
//Plots
plotbar(kc_lvlopen,kc_lvlhigh,kc_lvllow,kc_lvlclose,color=kc_colbar,editable=true)
plot(kc_lvloneup,color=#C285E6,style=line,linewidth=1,editable=false)
plot(kc_lvlonedn,color=#C285E6,style=line,linewidth=1,editable=false)
plot(kc_lvltwoup,color=#C285E6,style=line,linewidth=1,editable=false)
plot(kc_lvltwodn,color=#C285E6,style=line,linewidth=1,editable=false)

kc_mult3=input(3,title="Keltner Channel Third Multiple") // added by me​
Reply
Thank you ! for the novel way of representing the Keltner Channel and that too as an Oscillator with a slight twist to the calculation.

Thought I am very late to see the Indicator, Just by glancing at this, I started liking it very much. In order to identify extremes, I have added the following third levels

kc_threeup=kc_ma+kc_rng*kc_mult3 // added by me
kc_threedn=kc_ma-kc_rng*kc_mult3 // added by me

kc_lvlthreeup=(kc_threeup-kc_ma)/kc_rng // added by me
kc_lvlthreedn=(kc_threedn-kc_ma)/kc_rng // added by me

plot(kc_lvlthreeup,color=#C285E6,style=line,linewidth=1,editable=false) // added by me
plot(kc_lvlthreedn,color=#C285E6,style=line,linewidth=1,editable=false) // added by me
Reply
Well done
Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar Shows How It Works Chart Features Pricing House Rules Moderators Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Help Center Refer a friend Feature Request Blog & News FAQ Wiki Twitter
Profile Profile Settings Account and Billing Refer a friend My Support Tickets Help Center Ideas Published Followers Following Private Messages Chat Sign Out