<br / translate="no"> When there is no indentation FirstVisibleBar( ) = BarsPerWindow( ).
So what? Swipe the chart right and left, at the beginning (with the home button) and look at the value produced by the FirsVisibleBar function. But be sure to disable autoscrolling of the chart before doing so.
Which system functions and libraries need to be connected to - getting the vertical and horizontal size of the current chart in pixels; - Get maximum and minimum visible quotations of the current chart; - get the total number of expanded chart in the window ???
Maybe it makes sense to complement MQL4 language with appropriate functions ?
We need a function that returns the number of bars in the current chart window, taking into account the presence/absence of indentation from the right edge of the chart.
<br / translate="no"> We need a function that returns the number of bars in the current chart window, taking into account the presence / absence of indentation from the right edge of the chart.
Why? Despite the indentation, the chart window can be filled completely. And despite the lack of indentation, the chart window may be not filled.
The user is using charts indented from the right edge. How many bars are displayed on such a graph ? Pure geometric constant, independent of periods, history, scrolling and everything else.
I personally find jumps of 20 times or more and delays in FirstVisibleBar( ) unacceptable.
Which system functions and libraries must be included to
- getting the vertical and horizontal size of the current chart in pixels; - obtain the maximum and minimum visible quotations of the current chart; - get the total number of expanded chart in the window ???
Maybe it makes sense to complement MQL4 language with appropriate functions ?
1. GetClientRect from user32.dll 2. There is no special function. You can calculate by yourself, based on FirstVisibleBar() and BarsPerWindow() 3. What is "total number of graphs in the window"? If it is a subwindow with indicators, the built-in function WindowsTotal() will help. If it is about open charts in the client terminal, then it cannot be determined directly - only through corresponding WinAPI functions in your own dll.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
The geometric dimensions of the graph are unchanged.
FirstVisibleBar( ) = BarsPerWindow( ) - indent from right edge;
BarsPerWindow( ) = const, not dependent on period and data.
indent from right edge = const, not dependent on period and data.
FirstVisibleBar( ) = BarsPerWindow( ) - indent from the right edge;
Where did you get this formula from?
The first visible bar on the chart and the number of bars fit into the chart window have nothing to do with each other
Under these conditions, FirstVisibleBar( ) still has the wrong start value when switching periods.
So what? Swipe the chart right and left, at the beginning (with the home button) and look at the value produced by the FirsVisibleBar function. But be sure to disable autoscrolling of the chart before doing so.
Which system functions and libraries need to be connected to
- getting the vertical and horizontal size of the current chart in pixels;
- Get maximum and minimum visible quotations of the current chart;
- get the total number of expanded chart in the window ???
Maybe it makes sense to complement MQL4 language with appropriate functions ?
Why?
Despite the indentation, the chart window can be filled completely.
And despite the lack of indentation, the chart window may be not filled.
I personally find jumps of 20 times or more and delays in FirstVisibleBar( ) unacceptable.
Which system functions and libraries must be included to
- getting the vertical and horizontal size of the current chart in pixels;
- obtain the maximum and minimum visible quotations of the current chart;
- get the total number of expanded chart in the window ???
Maybe it makes sense to complement MQL4 language with appropriate functions ?
Thank you.
2. There is no special function. You can calculate by yourself, based on FirstVisibleBar() and BarsPerWindow()
3. What is "total number of graphs in the window"? If it is a subwindow with indicators, the built-in function WindowsTotal() will help. If it is about open charts in the client terminal, then it cannot be determined directly - only through corresponding WinAPI functions in your own dll.
Now we will not add anything to the language.