Hi - Are your buy/sell prices outside the actual high-low price range? You could try adding this to your code to see if it helps...
SetOption( "PriceBoundChecking", False ) Steve ----- Original Message ----- From: "cdepuy" <[EMAIL PROTECTED]> To: <amibroker@yahoogroups.com> Sent: Tuesday, February 19, 2008 4:45 PM Subject: [amibroker] Buyprice question >I am trying to have Amibroker backtest "execute" on prices that are > something other than Open, Low, High, Close or Average (as specified > in Backtester settings under Trade tab). I expected the code below, > using BuyPrice variable to force backtesting to operate on my fixed > values of x and y below (as described in Controlling trade price of > the 5.0 User's Guide). Can anyone help me understand why this still > operates on Close price (my current backtester settings). > > > > > > //I am trying to get this to place buy trade at x (43.34) and sell > //trade at 43.28. It is still trading at Close price instead. > > x = 43.34; > y=43.28; > > > period = 5; > Plot(MA(C,period),"ma5",colorBlue,styleLine); > PlotOHLC(O,H,L,C,"OHLC",colorBlack,styleCandle); > Plot(x,"x",colorRed,styleLine); > Plot(y,"y",colorRed,styleLine); > > BuyPrice = x; > SellPrice = y; > Buy = C > MA(C,period); > Sell = C < MA(C,period); > Buy=ExRem(Buy,Sell); > Sell=ExRem(Sell,Buy); > > PlotShapes(Buy*shapeUpArrow,colorGreen); > PlotShapes(Sell*shapeDownArrow,colorRed); > > > > > > 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 > > > >