This is because in your formula you are using ExRem. Best regards, Tomasz Janeczko amibroker.com ----- Original Message ----- From: "dralexchambers" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Friday, February 02, 2007 4:56 PM Subject: [amibroker] Backtester: not selling out on same day as entry
>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 (B). > > However, the backtester enters on (B) but exits on (C)! > > 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); > > > > Please note that this group is for discussion between users only. > > To get support from AmiBroker please send an e-mail directly to > SUPPORT {at} amibroker.com > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > http://www.amibroker.com/devlog/ > > For other support material please check also: > http://www.amibroker.com/support.html > > Yahoo! Groups Links > > > > >
