Hi, Are Trailing Stops and Stop Profit instructions in AmiBroker giving reliable results ?
I created a simple code ( see the AFL code below), but when I back-test it, I obtain a lot of ApplyStop (stopTypeTrailing & stopTypeProfit) false signals, as shown on the picture ( a false stopTypeTrailing on the left and a false stopTypeProfit on the right) http://img54.imageshack.us/img54/7419/e007.gif My settings to this strategy ( I have marked ON) : Activate stops immediately, Reverse entry signal forces exit, Allow same bar exit. Can somebody check it and confirm or deny my observations ? Regards Rem PositionSize = MarginDeposit = 1; ApplyStop(stopTypeTrailing, stopModePoint, TickSize * Param("stopTypeTrailing", 30, 2, 100, 1 ), 1 ); ApplyStop(stopTypeProfit, stopModePoint, TickSize * Param("stopTypeProfit", 10, 2, 100, 1 ), 1 ); bottomLevel = Open - 10*TickSize; // = Buy level Buy = bottomLevel >= Low ; BuyPrice = bottomLevel ; topLevel = Open + 10*TickSize; // = Short level Short = topLevel <= High ; ShortPrice = topLevel ; Cover= Buy ; Sell= Short ; CoverPrice= IIf( bottomLevel >= Low, BuyPrice, Close); SellPrice= IIf(topLevel <= High, ShortPrice, Close); Plot(topLevel, "topLevel", colorRed); Plot(bottomLevel, "bottomLevel", colorGreen);
