CooperHoang

CCI Momentum

160 0 8
green = momentum up
red = momentum down
no color = range bound
Remove from Favorite Scripts Add to Favorite Scripts
study(title="Commodity Channel Index", shorttitle="CCI")
length = input(20, minval=1)
src = input(close, title="Source")
ma = sma(src, length)
length1 = input(60, minval=1)
ma1 = sma(src, length1)
length2 = input(240, minval=1)
ma2 = sma(src, length2)

cci = (src - ma) / (0.015 * dev(src, length))
cci1 = (src - ma1) / (0.015 * dev(src, length1))
cci2 = (src - ma2) / (0.015 * dev(src, length2))
data = cci > 0 and cci1 > 0 and cci2 > 0
data1 = cci < 0 and cci1 < 0 and cci2 < 0

bgUp    = (data) ? green : na
bgDown  = (data1) ? red : na

bgcolor(bgUp, transp=50)
bgcolor(bgDown, transp=50)
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Forex Signal Finder 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 Account and Billing Sign Out