Hi, Thank you very much for your explanation.
I misunderstood the meaning of "Activate stops immediately". After setting it OFF, the instruction ApplyStop (stopTypeProfit) works as I wanted. As far as ApplyStop (stopTypeTrailing) , after analyzing the code from http://www.amibroker.com/kb/2007/03/24/how-to-plot-a-trailing-stop-in-th\ e-price-chart/ it seems to me that Amibroker calculates trailing stop levels based on extremes of bars, including the order entry bar( what make sometimes additional signal, as in my example). So my question: Is there any way, in standard Amibroker settings, to force ApplyStop to calculate trailing stop level for the entry bar(ONLY) based on entry price and on Close (and for all other bars - on extremes) ? Best Regards Rem --- In [email protected], "Tomasz Janeczko" <gro...@...> wrote: Wrong settings. Read the manual. Also "activate stops immediatelly" should only be used if you enter trades on *OPEN* price as it is said in the manual (see ApplyStop description). Your pictures show clearly that you are _NOT_ entering on open ! Also check this: http://www.amibroker.com/kb/2007/03/24/how-to-plot-a-trailing-stop-in-th\ e-price-\ chart/ Best regards, Tomasz Janeczko amibroker.com ----- Original Message ----- From: "rem_yah" <rem_...@...> To: <[email protected]> Sent: Sunday, April 05, 2009 3:08 AM Subject: [amibroker] Are Trailing Stops & Stop Profit instructions giving reliable results ? 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);
