Does Amibroker allow two trailing stops? I've been trying to code two trailing stops with different criteria in Amibroker 5.10. Why do this: Some, but not all, of the ATR-based trailing stops allow too big of a loss when the 7% stop seems to catch them earlier.
Here is what I've tried: The first criterion is for a 7% trailing stop. The second criterion is for an ATR-based trailing stop. They are in this order in the code. When running the code, it displays on a chart the two trailing stops as expected. However, when I look at the resulting table in the Automatic Analysis window, it doesn't show the 7% trailing stop data. However, the ATR-based stop does show in the table. >From the settings button and then the Backtester window, and then the Stops >tab, I disabled the trailing stops. I did this because the software code by >the user overrides the backtester settings as I understand it. My backtest mode: SetBacktestMode(backtestRegular); Here is the 7% trailing stop code: ApplyStop(2,1,7,1,False,1); Equity(1,0); //ThIS EVALUATES STOPS. Plot(Sell==4,"7% Loss",colorBlue,styleArea|styleOwnScale);//4 is for trailing stops For the ATR-based trailing stop: TrailStop = 0; TrailStop = HHV( C - 3* ATR(10),15); Sell = C < TrailStop OR Open < TrailStop OR Low < TrailStop; //must tell it when to sell ApplyStop(2, 2, TrailStop, 1, False, 1) ; Equity(1,0); //ThIS EVALUATES STOPS Plot(Sell,"Trlng Stop 3*atr(10)",colorOrange,styleArea|styleOwnScale); So, either the application won't recognize two trailing stops criteria or I have overlooked something. I think it is the latter, but I just don't know where. My test cases were Powershares ETFs from 1 Sep 08 through 4 Apr 09. Will anyone point me to a solution? Regards
