Mr D
New member
Triggers on RSI Histo bomb and on RSI Histo just exceeding 20
Ruby:
def str = RSI(length = 8)-50;
plot rsi=if str[1]> 20 and str[2]< 20 then max(str[1]-str[2],str[1])
else if str[1]<-20 and str[2]>-20 then min(str[1]-str[2],str[1])
else str[1] - str[2];
def sma = MovingAverage(data = CLOSE, length = 9);
def up = rsi> 10 and str[1]>0 and close[1]>sma[1] and sma[1]>sma[2];
def dn = rsi<-10 and str[1]<0 and close[1]<sma[1] and sma[1]<sma[2];
rsi.assignValueColor( if dn or up then color.black else color.white);
assignbackgroundcolor(if up then color.green else if dn then color.red else color.dark_gray);