If your sell conditions are based upon a value that occurs at your buy bar, or after it then exrem will not work. You could try adding Equity(1,0); to your code or you will need to write the trade conditions into a loop where you can positively identify when you are in a trade and control your required exit conditions
-- Cheers Graham AB-Write >< Professional AFL Writing Service Yes, I write AFL code to your requirements http://e-wire.net.au/~eb_kavan/ab_write.htm On 26/06/06, mikelaurataylor <[EMAIL PROTECTED]> wrote: > Thanks. I'll take a look at these answers. > > --- In [email protected], Daniel LaLiberte <[EMAIL PROTECTED]> wrote: > > > > Using ExRem on Buy and Sell will eliminate all but the first Buy and > Sell in > > each segment, but BuyPrice will continue to be whatever the buy > price is as > > if you were going to buy again at each time bar. So you want to > select the > > BuyPrice at the time of the last Buy signal (after applying ExRem), > which is > > > > buyExRem = ExRem(Buy, Sell); > > price = ValueWhen(buyExRem, BuyPrice); > > > > Another way to compute this, and also to adjust the price selected > based on > > your delay until actual buy (unless the BuyPrice already accounts > for this > > delay - I'm not sure): > > > > sinceBuy = BarsSince(buyExRem); > > delay = 1; > > price = Ref( BuyPrice, - sinceBuy + delay); > > > > dan > > > > On Saturday 24 June 2006 07:46 pm, mikelaurataylor wrote: > > > If I build a model for buying/selling and I want to, for instance, > > > create my own artificial stop based on the buy price i need to know > > > the buy price of my item. > > > > > > Even if I use the exrem statement on a buy the buyprice array does not > > > necessarily remain the original buy price if other buys occur (but do > > > not get executed.) > > > > > > I know you can set a % stop in the program so the backtest program > > > must know what the buy price was so I was wondering if there is a way > > > to get this amount without delving into the backtesting interface. > > > > > > Hope I asked the question clearly enough for someone to help. > > > > > > Thanks > > > > > > Mike > > > > > > > > > > > > > > > > > > > > > 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 other support material please check also: > > > http://www.amibroker.com/support.html > > > > > > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > > 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 other support material please check also: > http://www.amibroker.com/support.html > > > Yahoo! Groups Links > > > > > > > ------------------------ Yahoo! Groups Sponsor --------------------~--> Great things are happening at Yahoo! Groups. See the new email design. http://us.click.yahoo.com/TISQkA/hOaOAA/yQLSAA/GHeqlB/TM --------------------------------------------------------------------~-> 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 other support material please check also: http://www.amibroker.com/support.html Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/amibroker/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
