
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
A combination of Highest(), Lowest(), BarsPerWindow() and FirstVisibleBar() functions.
I still haven't got an answer to my question:
Why right after compilation FirstVisibleBar( ) returns 9104, but
after the first tick comes, FirstVisibleBar( ) = 409, which is 22 times less.
Sometimes you have to wait for about a minute for the first tick to come.
The BarsPerWindow() function has no such strangeness.
What system functions and libraries need to be connected to
- obtaining the vertical and horizontal size of the current chart in pixels;
- getting the maximum and minimum visible quotes of the current chart;
- to get the total number of expanded graphs in the window?
Maybe it makes sense to complement MQL4 language with appropriate functions ?
You won't get an answer until you submit your code.
Apart from that, it would be good to know the settings of the relevant graph.
Comment ( " ", BarsPerWindow(), " ", FirstVisibleBar( ), " ", Bars );
The effect of jumping FirstVisibleBar( ) occurs immediately after the indicator is attached to the chart and when switching from a larger period to a smaller one. It appears on any currency pair.
Which chart settings are of interest ?
When you switch, you try to set the chart to its positioning point. This is the jump I was telling you about as well.
The FirstVisibleBar function just returns the number of the first visible bar. Nothing more.
Because it is a constant value. As long as you don't change either the size of the chart window or its scale.
The value of FirstVisibleBar( ) depends on BarsPerWindow() and the indent from the right border of the chart.
Why do these functions need to swap data? When the period is switched, the value of the indent from the right border of the chart does not change.
The data is pumped automatically when the timeframe is changed.