BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: Total number of bars on the chart
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Total number of bars on the chart

 Post Reply Post Reply
Author
Message / View First Unread Post
Owen View Drop Down
Regular
Regular


Joined: 15 Nov 2004
Posts: 97
Post Options Post Options   Quote Owen Quote  Post ReplyReply Direct Link To This Post Topic: Total number of bars on the chart
    Posted: 15 Jul 2007 at 11:18pm
How do I get Bullcharts to return the total number of bars I have in my database? For XJO for example.

I've tried using barssince (c>0), thinking the 1st bar must close >0, so that should tell me how many bars have occurred since the 1st day. But that doesn't work.
Back to Top
chart rider View Drop Down
Regular
Regular
Avatar

Joined: 25 Sep 2004
Location: Australia
Posts: 96
Post Options Post Options   Quote chart rider Quote  Post ReplyReply Direct Link To This Post Posted: 18 Jul 2007 at 8:31pm

Owen

Your code will start counting again from every bar, so will always return the value of 1, because it's always been 1 day since the last time C > 0.

This will work:

firstBar := if(barnumber=1, 1, 0);

barsSince(firstBar=1);

CR

Back to Top
Owen View Drop Down
Regular
Regular


Joined: 15 Nov 2004
Posts: 97
Post Options Post Options   Quote Owen Quote  Post ReplyReply Direct Link To This Post Posted: 18 Jul 2007 at 11:12pm
Thank you CR! 

I didn't realise there is a "barnumber" function. This will make lot of things so much easier!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz