MQL4参考 图表操作 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--)
    {
     // ...
    }