matt5151

Commodity Channel Index/RSI

155 1 48
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
United States
United Kingdom
India
Deutschland
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
Malaysia
日本
한국
简体
繁體
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 Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing Priority Support Ideas Published Followers Following Private Messages Chat Sign Out