srengret Have you tried:
Shape = iif(buy,shapeUpArrow,ShapeNone); instead of Shape = buy * ShapeUpArrow; // ?? Until I used that format I too used to get shapes plotted I did not expect. Each shape has a numerical value. Something to do with summing these and getting a new value. Regards ChrisB srengret wrote:
I've overlooked something in shapes for sell arrows in an indicator test. I'm using Amibroker 4.90.5. I obtained more sell arrows than I thought should display. The trailing stops seem to be okay. For instance, I obtain sell arrows that are shaped as triangles when I don't see that in the code nor do I see where I set that sell criteria. For the test, the ETF that I used for an example here is symbol MZZ from October 2007 to now. Here's my test code sample: Buy =Close > 5 AND Close < 100 AND Close > 1.009*(EMA(Close, 30)) AND Close > Ref(Close,-1) AND RelStrength( "^DJI" ) > 1.0 AND Volume > 1.4*(EMA(V,30) ) AND RelStrength( "^GSPC") > 20.0; shape=Buy*shapeUpAr row; PlotShapes( shape, IIf( Buy, colorGreen, colorRed), 0, IIf( Buy, C,C ), 0 ); //If no buy signal given, it won't give a sell signal Sell=0; //Trailing Stop at 7% Loss ApplyStop(2, 1,7,False, 0); Equity(1,0); // THIS EVALUATES STOPS Plot(Sell==4, "HELPapplyStop sell",colorRed, 4|styleOwnScale) ;//4 is for trailing stops //shape = Buy * shapeUpArrow + Sell * shapeDownArrow; shape = Sell * shapeDownArrow; PlotShapes( shape, IIf( Buy, colorGreen, colorRed), 0, IIf( Buy, C, C-1), 0 ); I have no idea what I've overlooked. Maybe I over-complicated the PlotShapes function. Would someone look at or try this and let me know what to change? Regards.
