Maximum and minimum visible quotes - page 3

 
Why is the start value of FirstVisibleBar( ) incorrect ???

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.
 
Why is стартовое значение FirstVisibleBar( ) wrong ???
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
 
When there is no indentation FirstVisibleBar( ) = BarsPerWindow( ).

Under these conditions, FirstVisibleBar( ) still has the wrong start value when switching periods.
 
<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.
 
Very interesting questions were asked by belkor.

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.
 
Gentlemen developers, please advise

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.
 
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.

Now we will not add anything to the language.