// Downloaded From https://www.WiseStockTrader.com
_SECTION_BEGIN("RSIa");

P = ParamField( "Price field" );
periods = Param("Periods", 13, 1, 200, 1 );

Upper=Param("Upper", 70, 50, 100, 1);
Lower=Param("Lower", 30, 0, 50, 1);

rsiBuy = RSIa( P, periods) < Lower;
rsiSell = RSIa( P, periods) > Upper;

Buy = ExRem( rsiBuy, rsiSell );
Sell = ExRem( rsiSell, rsiBuy ); 

Cover = Buy;
Short = Sell;

Plot(Upper,"Upper",ParamColor( "ColorUpper", colorRed ),styleLine);
Plot(Lower,"Lower",ParamColor( "ColorLower", colorGreen ),styleLine);

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorGreen,0,L);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed);

Plot( RSIa( P, periods), _DEFAULT_NAME(), ParamColor( "Color", colorBlue ), ParamStyle("Style")  );


_SECTION_END();