You could just add a condition that the next buy cannot be in the same hour as the last sell.
-- 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 23/07/06, nightscalper <[EMAIL PROTECTED]> wrote: > Hello all, > > for backtesting purposes I want to define "nBarsWait" like this: > > nBarsWait = 60 - Minute(); > ApplyStop(stopTypeLoss,stopModePoint,nStop,1,False,nBarsWait); > ApplyStop stopTypeProfit,stopModePoint,nTarget,1,False,nBarsWait); > > But the applystop function does not allow me to do this. > > My aim is, that, after a Buy signal was previously generated > and the position is closed by applystop function, I want my > trading system to wait until the next full hour starts until > it is ready again for opening the next Buy position. > > In realtime trading it should work (see fomula below) but for > backtesting with historical data, the applystop function does > not accept referencing to the bar“s minute "Minute()". > > Will appreciate any help. > Thanks and regards. > Robert > > _________________________________________________________________ > Time = Now(4); > CurMinute = int(Time/100%100); > nBarsWait = 60 - CurMinute; > ApplyStop(stopTypeLoss,stopModePoint,nStop,1,False,nBarsWait); > ApplyStop stopTypeProfit,stopModePoint,nTarget,1,False,nBarsWait); > _________________________________________________________________ > > > > > > > > > > > > > > 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/
