MQL4 Reference Chart Operations WindowBarsPerChart

MQL4 Help as One File:

WindowBarsPerChart

Returns the amount of bars visible on the chart.

int  WindowBarsPerChart();

Parameters

None.

Returned value

The amount of bars visible on the chart.

Example:

// work with visible bars.
  int bars_count=WindowBarsPerChart();
  int bar=WindowFirstVisibleBar();
  for(int i=0; i<bars_count; i++,bar--)
    {
     // ...
    }