Print Page | Close Window

Total number of bars on the chart

Printed From: BullCharts Forum
Category: BullCharts
Forum Name: BullScript
Forum Discription: Technical discussion related specifically to the BullScript programming language.
URL: http://www.bullcharts.com.au/forum/forum_posts.asp?TID=430
Printed Date: 24 Apr 2025 at 12:53am
Software Version: Web Wiz Forums 9.69 - http://www.webwizforums.com


Topic: Total number of bars on the chart
Posted By: Owen
Subject: Total number of bars on the chart
Date 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.



Replies:
Posted By: chart rider
Date 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



Posted By: Owen
Date 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!



Print Page | Close Window

Bulletin Board Software by Web Wiz Forums® version 9.69 - http://www.webwizforums.com
Copyright ©2001-2010 Web Wiz - http://www.webwiz.co.uk