[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Referencing a point in time



PureBytes Links

Trading Reference Links

You could first create a start-of-day signal array by checking for the
date not being equal to the date of the previous bar. That would be
something like this:

dn = DateNum();
StartDay = dn != Ref(dn, -1);

That should give a one at the first bar of each new day.

Once you have that, you could sum the volume a few ways, depending on
exactly where you want the resulting numbers to be. Say you want them
just on the last bar of those periods, then you could use something like:

volSum = IIf(Ref(StartDay,-25), Sum(V, 25), 0);

That says when the first bar of the day was 25 bars ago, store the
value of the 25-bar sum of volume, otherwise store zero. So the volSum
array would end up full of zeroes except for the 25th bar of each day
which would have the sum of the previous 25 bars' volume.

I don't have intra-day data so can't check this, but I think it should
work.

Regards,
GP


--- In amibroker@xxxxxxxxxxxxxxx, "hrokling" <henning@xxx> wrote:
>
> I'm working on an Exploration, and want to REF the first 25 minutes of 
> the trading day (using a 1-min database). Would the right way to do 
> this be to find out what the time is for the current bar and then 
> calculate back in the array to figure out the timeperiod I want to 
> reference?
> 
> I'm looking for the sum of the volume for this time period. TIA - any 
> advise is much appreciated.
>




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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/