Forums ProRealTime English forum ProBuilder support Determine the charts time frame in a program Reply To: Determine the charts time frame in a program

#126835

I have to calculate the number of bars in a theoretical 24-hour working day for my chart, in which user choice timeframe

Why not start a bar count at the start of a day when OPENDAYOFWEEK <> OPENDAYOFWEEK[1] and also a day count at the start of each day. Then if you get x days with the same bar count value that confirms that that is the number of bars in your day. In v11 this is very easy with arrays but in v10.3 you would have to have x separate variables and fill their values by adding a new one and dropping off an old one. Once all x variables are equal that is our number of bars in the day.