RicardoSantos

[RS]Dynamic Range Commodity Channel Index V0

EXPERIMENTAL:
request from anonimm
Remove from Favorite Scripts Add to Favorite Scripts
study(title="[RS]Dynamic Range Commodity Channel Index V0", shorttitle="DR-CCI", overlay=false)
length = input(title='CCI Length:', type=integer, defval=20)
smooth = input(title='CCI Smoothing:', type=integer, defval=1)
f_cci(_src, _length) =>
    _ma = sma(_src, _length)
    _return = (_src - _ma) / (0.015 * dev(_src, _length))

c = ema(ema(f_cci(close-close[1], length), smooth), smooth)
pos = stdev(c, length)
neg = -stdev(c, length)

h = highest(max(pos, neg), length)
l = lowest(min(pos, neg), length)

ob = plot(title='OB', series=h, color=lime)
os = plot(title='OS', series=l, color=red)
fill(ob, os, color=silver, transp=50)

plot(title='CCI', series=c, color=black)
anonimm
a year ago
Thank you for your kindly help.
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out