WindowBarsPerChart - Chart Operations - MQL4 Reference

MQL4 Reference Chart Operations WindowBarsPerChart

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--)
    {
     // ...
    }