PureBytes Links
Trading Reference Links
|
This would give you the changeover at midnight per your database settings
If you need to use times during the day to define sessions then just use
timenum
this will give session times for 10am to 4pm, just adjust the times and < <=
> >= conditions to suit how you have the bar period times shown, ie shows at
start or end of period per your preferences
Start = ref(timenum(),-1)<100000 and timenum()>=100000;
Finish = timenum()<=160000 and ref(timenum(),1)>160000;
--
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 21/09/06, J. Biran <jbiran@xxxxxxxxxxx> wrote:
>
>
> That was my initial thought too, but, what do you do if the data base is
> 24hr data?
>
>
> Joseph Biran
> ____________________________________________
> ------------------------------
> *From:* amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] *On
> Behalf Of *Graham
> *Sent:* Wednesday, September 20, 2006 3:29 PM
> *To:* amibroker@xxxxxxxxxxxxxxx
> *Subject:* Re: [amibroker] first/last 1-minute bar of each day
>
> Try this
> FirstBar = datenum()!=ref(datenum(),-1);
> Lastbar = datenum()!=ref(datenum(),1);
>
>
> --
> 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<http://e-wire.net.au/%7Eeb_kavan/ab_write.htm>
>
>
> On 20/09/06, dirk schreiber <tianatrading@xxxxxxxxx> wrote:
> >
> > hello group,
> >
> > i want to simulate/backtest a system which closes all positions via MOC.
> > how do i reference the LAST 1-minute bar for each individual day (sometimes
> > my DB has 15:59, sometimes 15:58, sometimes 16:00 etc.)
> > and how would i code the FIRST 1-minute bar for the day?
> >
> > thanks,
> > dirk
> >
> > ------------------------------
> >
>
>
|