Help with Ami Buy/Sell coding

Please help me to code my strategy on amibroker.

BUY when Green candle + EMA3 above EMA15 + RSI(15) above 5EMA of RSI(15) + ROC(10) above 5EMA of ROC(10)

SELL when Red candle + EMA3 below EMA15 + RSI(15) below 5EMA of RSI(15) + ROC(10) below 5EMA of ROC(10)

Green Arrow for BUY / Red Arrow for SELL

Thank you

Veena

Please find the code 

_SECTION_BEGIN("NeoStrategy");

EMA3 = EMA(Close, 3);
EMA15 = EMA(Close,15);
rsi15 = RSI(15);
rsiema5 = EMA(RSI(15),5);
roc10 = ROC(Close,10);
roc10ema5 = EMA(ROC(Close,10),5);

Buy = IIf((EMA3 > EMA15) AND (rsi15 > rsiema5) AND (roc10 > roc10ema5), 1 , 0);
Sell = IIf((EMA3 < EMA15) AND (rsi15 < rsiema5) AND (roc10 < roc10ema5), 1 , 0);

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

Plot( C, "Close", colorDefault, styleNoTitle | GetPriceStyle() );
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);

_SECTION_END();

Regards

Vivith

1 Like

Vivith
Thanks a lot.
I want sound alert. Please help.
Veena

Veena,
Please add below code to the strategy, you should get sound alerts.
if(SelectedValue(Buy) == 1)
{
Say(“Buy Signal triggered at”+C);
}
if(SelectedValue(Sell) == 1)
{
Say(“SellSignal triggered at”+C);
}
Regards
Vivith

Thanks a lot Vivith : )