Skip to main content

RSI AUTO TRADE for Amibroker (AFL)

edgainbc over 13 years ago Amibroker (AFL)

  • Rating:
    3 / 5 (Votes 2)
  • Tags:
    oscillator, trading system, amibroker

13 period RSI high level is set at 70 and the low level is set at 30.

Enter trade when Price crossed down 30 and exit trade when Price crossed over 70.

Backtests were good for many stocks.

Indicator / Formula

Copy & Paste Friendly
_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();

1 comments

over 13 years ago

wake up admin!

wht u r approving.

wht is the “X” u found in this code?

great…..!

Leave Comment

Please login here to leave a comment.