MQL4 - automated forex trading   /  

Documentation

MQL4 Reference  Timeseries access  iBars

 
int iBars( string symbol, int timeframe)
Returns the number of bars on the specified chart.
For the current chart, the information about the amount of bars is in the predefined variable named Bars.
Parameters:
symbol   -   Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
timeframe   -   Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.
Sample:
  Print("Bar count on the 'EUROUSD' symbol with PERIOD_H1 is",iBars("EUROUSD",PERIOD_H1));