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

[amibroker] Re: bar number of first bar of the day 5-min



PureBytes Links

Trading Reference Links

Can I at least find the barnumber of the first bar when the date changes?

--- In amibroker@xxxxxxxxxxxxxxx, "kar_avi" <kar_avi@xxx> wrote:
>
> This is used to get the Open and Close of the first bar in a 5 min
> chart as given by TJ.
> 
> DayChange = DateNum() != Ref( DateNum(), -1 );
> 
> FirstBarOpenInDay = ValueWhen( DayChange, Open );
> 
> FirstBarCloseInDay = ValueWhen( DayChange, Close );
> 
> 
> Now can I use the following to get the bar number of the first bar.
> 
> ***********
> 
> FirstBar = ValueWhen( DayChange, BarIndex() );
> 
> LastBar = BarCount - 1;
> 
> NoBars = lastvalue(BarCount  - FirstBar);
> 
> ***********
> Will this be problematic because of QuickAFL and Barindex().
> 
> In my program, the LastBar value changes the *second* time it is
> refreshed *without adding any new bar*. E.G if LastBar was 12466 the
> first time, it becomes 10111 to even 197 the second time and retains
> this value.
> 
> I want this as I want to draw the HHV(H,4) for all 4 consecutive bars
> starting from the FirstBar (first bar of the day onwards).
> 
> Any help will be appreciated.
> 
> Regards,
> Kar
>




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/