RSI-Based-Overbought-Oversold-Warning-Zone |
//www.aflcode.com _SECTION_BEGIN("Trigger"); SetChartBkColor( colorBlack ) ; f = Param("Rsi of",5,1,50,1); s = Param("ema of rsi",13,2,100,1); A1=round(EMA(RSI(f),s)*10)/10; BBtop=BBandTop(A1,5,.5); BBbot=BBandBot(A1,5,.5); Color = IIf(A1 > bbtop, colorBrightGreen, IIf(a1 < bbbot,colorRed,colorYellow)); Plot(a1,"rsi",color,styleDots+styleLine); Plot(80,"",31,1); Plot(20,"",31,1); _SECTION_END(); RSI13 = round(EMA( a1, 13 )*10)/10; RSI39 = round(EMA( a1, 39 )*10)/10; Plot( EMA( a1, 13 ), "", IIf(EMA( a1, 13 ) > Ref(EMA( a1, 13 ),-1),colorWhite,colorGrey40), styleThick ); Plot( EMA( a1, 39 ), "", IIf(EMA( a1, 39 ) > Ref(EMA( a1, 39 ),-1),colorAqua,colorBlue), styleThick+styleDashed ); thick = Param("thickness",0.25,0.1,5,0.1); diff = round((a1 - Ref(a1,-1))*10)/10; diff13 = round((RSI13 - Ref(RSI13,-1))*10)/10; diff39 = round((RSI39 - Ref(RSI39,-1))*10)/10; Title = EncodeColor(colorWhite)+"RSI = " +WriteIf(a1 > Ref(a1,-1),EncodeColor(colorBrightGreen),EncodeColor(colorRed))+ A1 +EncodeColor(colorWhite)+" diff : " + WriteIf(diff > 0, EncodeColor(colorBrightGreen)+diff,EncodeColor(colorRed)+diff) +"\n" +EncodeColor(colorWhite)+"RSI-13 = " +WriteIf(RSI13 > Ref(RSI13,-1),EncodeColor(colorBrightGreen),EncodeColor(colorRed)) + RSI13 +EncodeColor(colorWhite)+" diff : " + WriteIf(diff13 > 0, EncodeColor(colorBrightGreen)+diff13,EncodeColor(colorRed)+diff13) +"\n" +EncodeColor(colorWhite)+"RSI-39 = " +WriteIf(RSI39 > Ref(RSI39,-1),EncodeColor(colorBrightGreen),EncodeColor(colorRed)) + RSI39 +EncodeColor(colorWhite)+" diff : " + WriteIf(diff39 > 0, EncodeColor(colorBrightGreen)+diff39,EncodeColor(colorRed)+diff39) ; _SECTION_END();
Sign up here with your email
ConversionConversion EmoticonEmoticon