CooperHoang

CCI trend and extreme indicator

621 7 39
This employ multi time frame analysis to give a good visual of where is the market is at.

green = general market is trending up from the confluence of 3 different time frame
red = general market is trending down from the confluence of 3 different time frame
Bright green = overbought and trend is likely to reverse
Bright red = oversold and trend is likely to reverse
Remove from Favorite Scripts Add to Favorite Scripts
study(title="Commodity Channel Index", shorttitle="CCI Momentum")
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
bgUp1    = (cci > 200 and cci1 > 200 and cci2 >200) ? green : na
bgDown1    = (cci < -200 and cci1 < -200 and cci2 < -200) ? red : na
bgcolor(bgUp, transp=60)
bgcolor(bgDown, transp=60)
bgcolor(bgUp1, transp=0)
bgcolor(bgDown1, transp=0)
cool how do i insert this?
Reply
CooperHoang thetao_ofnow
You open the pine edit and simply add this code to it. then save it as your own, then add to chart to use it
+1 Reply
thetao_ofnow CooperHoang
i tried to add but only says "The script must have one study() or strategy() function call"
Reply
CooperHoang thetao_ofnow
Make sure you copy all the code, especially the top line
+1 Reply
thetao_ofnow CooperHoang
messed around some more and got it to work , thanks!
Reply
CooperHoang thetao_ofnow
You welcome!
Reply
Good One
Reply
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Contact Support Ideas Published Followers Following Private Messages Chat Sign Out