in Search

Intraday Bar Counter

Last post 01-13-2008, 13:46 by mstt. 1 replies.
Sort Posts: Previous Next
  •  01-10-2008, 5:05 26289

    Intraday Bar Counter

    Hi,

    I would like to have a code to count on the number of bars for the intraday, say 1 for the first intraday bar and then add up as more bars displayed.  It resets to one on the coming first intraday bar tomorrow.

    How can I do code it?

    Bullstock

  •  01-13-2008, 13:46 26312 in reply to 26289

    Re: Intraday Bar Counter

    Hi Bullstock

     

    This indicator should do what you want. You will need to install the Forum DLL from the Files section for this formula to function. Depending on the name you assign to the DLL you might need to change the ExtFml() function to match. I've used the Forum DLL to eliminate a leading N/A bar, which then allows an accurate bar count to be calculated for the first day. Hope this helps.

     

    {Intraday Bar Counter}

    D:=DayOfMonth();

    FirstBar:=Cum(1)=1;

    NewDay:=ExtFml("Forum.Sum",D<>Ref(D,-1),1);

    1 + BarsSince(FirstBar OR NewDay);

     

    Roy

    MetaStock Tips & Tools
View as RSS news feed in XML