matt5151

Commodity Channel Index/RSI

204 1 93
Remove from Favorite Scripts Add to Favorite Scripts
study(title="Commodity Channel Index/RSI", shorttitle="CCI/RSI")

length1 = input(14, minval=1)
length2 = input(5, minval=1)

src = input(close, title="Source")

ma = sma(src, length1)
ma2 = sma(src, length2)

cci = (src - ma) / (0.015 * dev(src, length1))
cci2 = (src - ma) / (0.015 * dev(src, length2))

up14 = rma(max(change(src), 0), length1)
down14 = rma(-min(change(src), 0), length1)
up5 = rma(max(change(src), 0), length2)
down5 = rma(-min(change(src), 0), length2)
rsi5 = down5 == 0 ? 100 : up5 == 0 ? 0 : 100 - (100 / (1 + up5 / down5))
rsi14 = down14 == 0 ? 100 : up14 == 0 ? 0 : 100 - (100 / (1 + up14 / down14))
//CCI here
plot(cci, color=green,linewidth=2,title = "cci-14")
plot(cci2, color=green,linewidth=2,title = "cci-5")
//RSI here
plot(rsi14, color=purple,title = "rsi-14")
plot(rsi5, color=blue,title = "rsi-5")
Hello,

The Vdubble bubble indicator based on which the buy and sell signals are generated repaints even after closing the candle. Please let us know if there is something better which doesn't repaint.
Reply
English
English (UK)
English (IN)
Deutsch
Français
Español
Italiano
Polski
Türkçe
Русский
Português
Bahasa Indonesia
Bahasa Melayu
ภาษาไทย
Tiếng Việt
日本語
한국어
简体中文
繁體中文
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