Skip to content

Instantly share code, notes, and snippets.

@marketcalls
Created November 18, 2014 12:18
Show Gist options
  • Save marketcalls/41d4e30e86306c2154fe to your computer and use it in GitHub Desktop.
Save marketcalls/41d4e30e86306c2154fe to your computer and use it in GitHub Desktop.
Simple RSI Crossover - Amibroker AFL code
_SECTION_BEGIN("RSI Crossover Alert");
SetChartOptions(0,0,chartGrid30|chartGrid70);
periods = Param( "Periods", 15, 1, 200, 1 );
RS= RSI( periods);
Plot( RS, _DEFAULT_NAME(), colorred, ParamStyle("Style") );
Plot (30, "Oversold", colorGreen,stylethick);
Plot (70, "Overbought", colorRed,stylethick);
buy = Cross(30,RS);
sell = Cross(RS,70);
shape = Buy * shapehollowsmallcircle + Sell * shapehollowsmallcircle;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, RS );
AlertIF( Buy, "SOUND C:\\Windows\\Media\\Ding.wav", "Audio alert", 1 );
AlertIF( Sell, "SOUND C:\\Windows\\Media\\Ding.wav", "Audio alert", 2 );
_SECTION_END();
@Mandy1973
Copy link

Hello,

I need AFL with RSI with popup alerts at 60 BUY & At 40 SELL
Can you help me on this.

at present using below formula, would like to add ALERT at 60 BUY & At 40 SELL -

_SECTION_BEGIN("RSI");
SetChartOptions(0,0,chartGrid30|chartGrid70);
periods = Param( "Periods", 15, 1, 200, 1 );
Plot( RSI( periods), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
_SECTION_END();

Rds,Mandy
[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment