MQL4 Reference
Window functions
WindowFirstVisibleBar
| int WindowFirstVisibleBar( |
) |
The function returns the first visible bar number in the current chart window. It must be taken into consideration that price bars are numbered
in the reverse order, from the last to the first one.
The current bar, the latest in the price array, is indexed as 0. The oldest bar is indexed as Bars-1.
If the first visible bar number is 2 or more bars less than the amount of visible bars in the chart,
it means that the chart window has not been fully filled out and there is a space to the left.
Sample:
// work with visible bars.
int bars_count=WindowBarsPerChart();
int bar=WindowFirstVisibleBar();
for(int i=0; i<bars_count; i++,bar--)
{
// ...
}
|
|
|