How to write this afl

I am not a coder- sorrry

I want these conditions in my afl

Time frame: 15 min

condition 1: buy when rsi(14)> 40 and close >sma(15)

condition2: sell when rsi(14)< 60 and close <sma(15)

_SECTION_BEGIN("SMA RSI");
SMA15 = MA(C,15);
RSI14 = RSI(14);

Buy= RSI14 > 40 AND C > SMA15;
Sell= RSI14 < 60 AND C < SMA15;
Buy= ExRem(Buy,Sell);
Sell= ExRem(Sell,Buy );
shape = Buy * shapeUpArrow + Sell * shapeDownArrow;

PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low, High ) );
_SECTION_END();

Save the above code in one file with afl extention, like sma-rsi.afl

open the amibroker and set interval to 15 min. drag and drop this afl to the chart.

1 Like

@trade100 Wow, great, will give it a try. Keep up the good work.

Thank you very much