Need AFL as per defined logic

#1
Hello,

I'm using below codes in Nest trader system and I want to create AFL using this code so that i can use it in Amibroker.

Nest trader Code :
BUY = EMA(CLOSE, 5) > SMA (CLOSE, 20) AND RSI (CLOSE, 21) < 40
SELL = EMA(CLOSE, 5) < SMA (CLOSE, 20) AND RSI (CLOSE, 21) > 60

BUY EXIT = RSI (CLOSE, 21) > 80
SELL EXIT = RSI (CLOSE, 21) < 30

Someone helped me to create below AFL but this is giving diffrent result in Amibroker Vs. Nest Trader.

AMibroker AFL:

Buy = EMA(Close, 5) > MA (Close, 20) AND RSI (21) < 40 ;
Short = EMA(Close, 5) < MA (Close, 20) AND RSI (21) > 60 ;

Cover = RSI (21) > 80 ;
Sell = RSI (21) < 30 ;


Buy = ExRem(Buy, Short OR Sell) ;
Short = ExRem(Short, Buy OR Cover) ;

Cover = ExRem(Cover, Buy) ;
Sell = ExRem(Sell, Short) ;

PlotShapes(Cover*shapeUpArrow, colorBlack, 0, L, -12) ;
PlotShapes(Sell*shapeDownArrow, colorBlack, 0, H, -12) ;

PlotShapes(Buy*shapeUpArrow, colorBlue, 0, H, 12) ;
PlotShapes(Short*shapeDownArrow, colorRed, 0, L, 12) ;
----

I've pulled below result in both platform using 5 minute interval.

Nest Trader Signals:
NIFTY13OCT 10/03/2013 01:25:00PM SHORT 5930.25
NIFTY13OCT 10/07/2013 09:20:00AM EXIT SHORT 5903
NIFTY13OCT 10/07/2013 11:25:00AM LONG 5878.5
NIFTY13OCT 10/08/2013 10:50:00AM SHORT 5990.75
NIFTY13OCT 10/09/2013 09:20:00AM EXIT SHORT 5907

AmiBroker Signals :

NIFTY13OCT 10/03/2013 10:24:59AM COVER 5931.14
NIFTY13OCT 10/03/2013 11:59:59AM SHORT 5921.85
NIFTY13OCT 10/07/2013 09:24:59AM SELL 5875
NIFTY13OCT 10/07/2013 11:29:59AM BUY 5880
NIFTY13OCT 10/08/2013 11:04:59AM SHORT 5993

Requesting you to create new AFL or modify above AFL so that it can pull same results as Nest Trader signals.

Thanks,