Graham, would you still give me a sample line of code.
I thought I know how to do it, but obviously I am still 
doing something wrong.

How can I code the condition "next buy cannot be in the 
same hour as the last sell" ?

Thanks so much.

Regards
Robert



--- In [email protected], "nightscalper" <[EMAIL PROTECTED]> 
wrote:
>
> Hello Graham, 
> 
> sometimes the solution is so close, that you dont´t see it :-)
> 
> Thank you very much for your help, Graham.
> Your solution just works fine !!!
> 
> Regards
> Robert
> 
> 
> --- In [email protected], Graham <kavemanperth@> wrote:
> >
> > 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 <nightscalper@> 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
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
>







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/
 


Reply via email to