RicardoSantos

[RS]andreas73 Multiple CCI V0

request for: andreas73
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?
//@version=2
study(title='[RS]andreas73 Multiple CCI V0', shorttitle='C')
src = input(title='Source:', type=source, defval=close)
//  ||  1st group Inputs
length_01 = input(title='Length 01:', type=integer, defval=21)
length_02 = input(title='Length 02:', type=integer, defval=25)
length_03 = input(title='Length 03:', type=integer, defval=30)
length_04 = input(title='Length 04:', type=integer, defval=35)
//  ||  2nd Group Inputs
length_05 = input(title='Length 05:', type=integer, defval=40)
length_06 = input(title='Length 06:', type=integer, defval=45)
length_07 = input(title='Length 07:', type=integer, defval=50)
//  ||  Levels Inputs
pos_lvl_01 = input(title='Positive Level 01:', type=float, defval=90)
pos_lvl_02 = input(title='Positive Level 02:', type=float, defval=150)
neg_lvl_01 = input(title='Negative Level 01:', type=float, defval=-90)
neg_lvl_02 = input(title='Negative Level 02:', type=float, defval=-150)

cci_01 = cci(src, length_01)
cci_02 = cci(src, length_02)
cci_03 = cci(src, length_03)
cci_04 = cci(src, length_04)
cci_05 = cci(src, length_05)
cci_06 = cci(src, length_06)
cci_07 = cci(src, length_07)

plot(title='C1', series=cci_01, color=orange, transp=00, linewidth=1, editable=true)
plot(title='C2', series=cci_02, color=orange, transp=20, linewidth=1, editable=true)
plot(title='C3', series=cci_03, color=orange, transp=40, linewidth=1, editable=true)
plot(title='C4', series=cci_04, color=orange, transp=60, linewidth=1, editable=true)
plot(title='C5', series=cci_05, color=blue, transp=00, linewidth=1, editable=true)
plot(title='C6', series=cci_06, color=blue, transp=25, linewidth=1, editable=true)
plot(title='C7', series=cci_07, color=blue, transp=50, linewidth=1, editable=true)

lp2 = hline(title='PL2', price=pos_lvl_02, color=black, linewidth=1, editable=true)
lp1 = hline(title='PL1', price=pos_lvl_01, color=black, linewidth=1, editable=true)
l00 = hline(title='L00', price=0, color=black, linewidth=1, editable=true)
ln1 = hline(title='NL1', price=neg_lvl_01, color=black, linewidth=1, editable=true)
ln2 = hline(title='NL2', price=neg_lvl_02, color=black, linewidth=1, editable=true)
fill(lp1, lp2, color=maroon, transp=80, title='Pf', editable=true)
fill(ln1, ln2, color=green, transp=80, title='Nf', editable=true)