Hi everyone
I need help to completed my AFL
Im using code to identify which buy and sell signal appear on my chart like in this article
http://www.amibroker.com/kb/2014/09/24/how-to-identify-which-signal-triggers/
im using shapedigit for buy and sell signal. the problem is, the sell signal keep appearing even the buy signal is not triggered and the shape causing to much noise to the chart, even after I use the exrem function. so can someone help me to completed it.
here the code
Buy1 = Condition1;
Buy2 = Condition2;
Buy3 = Condition3;
Sell1 = Condition4;
Sell2 = Condition5;
Buy = Buy1 OR Buy2 OR Buy3;
Sell = Sell1 or Sell2;
Buy = Exrem (Buy,Sell);
Sell = ExRem (Sell,Buy);
PlotShapes(IIf(Buy,shapeSmallUpTriangle,shapeNone),colorbrightGreen, 0, L, Offset=-10);
PlotShapes(IIf(Sell,shapeSmallDownTriangle,shapeNone), colorRed, 0, H, Offset=-10);
BuyReason = EncodeColor(colorbrightGreen ) + WriteIf(Buy,"Buy signals: ","")
+ WriteIf(buy1, "1.Cross_Line", "") +WriteIf(buy2, "2.Datar-Naik", "")
+ WriteIf(buy3, "3.Turun-Naik", "");
SellReason = EncodeColor(colorGreen ) + WriteIf(Sell,",Sell signals: ","")
+ WriteIf(Sell1, "1.CutLoss/TrailingStop", "")
+ WriteIf(Sell2, "2.Cross_Wilders", "");
PlotShapes (Buy1*shapedigit1, colorbrightGreen, 0, Low,-21);
PlotShapes (Buy2*shapedigit2, colorbrightGreen, 0, Low,-40);
PlotShapes (Buy3*shapedigit3, colorbrightGreen, 0, Low,-55);
PlotShapes (Sell1*shapedigit1, colorRed, 0, High,21);
PlotShapes (Sell2*shapedigit2, colorRed, 0, High,40);
the very first two plotshape signal appear and dissappear like I want, but the last two plotshape always appear If sell1 and sell2 conditions meet. please help to clear up the sell signal. Thanks for your help.