- Indexing Direction in Arrays, Buffers and Timeseries
- Organizing Data Access
Returns the number of bars count in the history for a specified symbol and period. There are 2 variants of functions calls.
Request all of the history bars
Request the history bars for the selected time interval
[in] Symbol name.
[in] Bar time corresponding to the first element.
[in] Bar time corresponding to the last element.
If the start_time and stop_time parameters are defined, the function returns the number of bars in the specified time interval, otherwise it returns the total number of bars.
If data for the timeseries with specified parameters are not formed in the terminal by the time of the Bars() function call, or data of the timeseries are not synchronized with a trade server by the moment of the function call, the function returns a zero value.
When requesting the number of bars in a specified time interval, only bars with an open time falling within the interval are considered. For example, if the current day of the week is Saturday and the request is made for the number of W1 bars with start_time=last_tuesday and stop_time=last_friday, the function will return 0 since the open time of a W1 timeframe is always Sunday and not a single W1 bar falls within the specified interval.
Sample request for the number of all history bars:
Sample request for the number of bars in the specified interval: