satto.dallalst

_CM_RSI_2_HB_MA

91 0 8
RSI2
Remove from Favorite Scripts Add to Favorite Scripts
//Created by ChrisMoody 
//BarColor strategy for RSI-2 Paint Bars + 200SMA and 5 SMA
study("_CM_RSI_2_HB_MA", overlay=true)
src = close, 

//RSI Code
up = rma(max(change(src), 0), 2)
down = rma(-min(change(src), 0), 2)

rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
rsi_up = rsi > 90
rsi_down = rsi < 10

//MovAvg's Code
ma5 = sma(close,5)
ma200= sma(close, 200)

//Rules for Bar Colors
isLongEntry() => close > ma200 and close < ma5 and rsi < 10

isLongExit() => close > ma200 and close[1] < ma5[1] and high > ma5 and ((close[1] > ma200[1] and close[1] < ma5[1] and rsi[1] < 10) or (close[2] > ma200[2] and close[2] < ma5[2] and rsi[2] < 10) or (close[3] > ma200[3] and close[3] < ma5[3] and rsi[3] < 10) or (close[4] > ma200[4] and close[4] < ma5[4] and rsi[4] < 10) )

isShortEntry() => close < ma200 and close > ma5 and rsi > 90

isShortExit() => close < ma200 and close[1] > ma5[1] and low < ma5 and ((close[1] < ma200[1] and close[1] > ma5[1] and rsi[1] > 90) or (close[2] < ma200[2] and close[2] > ma5[2] and rsi[2] > 90) or (close[3] < ma200[3] and close[3] > ma5[3] and rsi[3] > 90) or (close[4] < ma200[4] and close[4] > ma5[4] and rsi[4] > 90) )
//Rules For MA Colors
col = ma5 >= ma200 ? lime : ma5 < ma200 ? red : na
barcolor(isLongEntry() ? lime : na)
barcolor(isLongExit() ? yellow : na)
barcolor(isShortEntry() ? red : na)
barcolor(isShortExit() ? yellow : na)
plot(ma5, color=col, title="5 SMA", style=line, linewidth=3)
plot(ma200, color=col, title="200 SMA", style=circles, linewidth=3)
Ideas Scripts Chart
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
日本
한국
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