Can I at least find the barnumber of the first bar when the date changes? --- In [email protected], "kar_avi" <[EMAIL PROTECTED]> 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 >
