Bars on chart from different time frame?

 

I'm working on a statistics indicator that shows the average range of different time frames. If I am looking at the 1hr chart and want to get the total number of bars on the daily chart to calculate the average, how do I do this? "Bars" only tells you how many bars are on the current chart. Any suggestions would be very appreciated and I'll definitely post the statistics indicator as my first contribution to this site once finished. Just need to fix this one last part... Thank you.

 

use IBar. see also iBarShift.

int Bars_D1 = iBars(Symbol(), PERIOD_D1);

 
cameofx:

use IBar. see also iBarShift.

int Bars_D1 = iBars(Symbol(), PERIOD_D1);


Thanks cameofx. Exactly what I needed.
Reason: