Sorry - I made a mistake with the original posting! Here is the correct version: :)
======================================================= I have some backtester code below. Despite setting the "AllowSameBarExit" option to True, the position is not being sold on the same day. See this JPG for my explanation: http://www.chambers-media.com/01.jpg The black arrow is the setup day The green arrow is the buy day The blue line is a trailing stop loss. When the low of the day passes through the low, a sell is triggered. The position should enter and exit on the same day (A). However, the backtester enters on (A) but exits on (B)! Can anyone suggest - alex ============================== SetOption("FuturesMode" , False); SetBarsRequired(10000,10000); SetTradeDelays(0,0,0,0); SetOption("AllowSameBarExit",True); SetOption("MarginRequirement",0); SetOption("MinShares",1); Buy = Longsetup AND H>StopBuy; BuyPrice = Max(Open,StopBuy); LongStop = (Low-1) - 0.0010; // Trail SL 10 pips behind Sell = L < LongStop; Buy = ExRem( Buy, Sell ); Sell = ExRem( Sell, Buy ); SellPrice = Min(Open,LongStop);
