Maximum and minimum visible quotes - page 4

 
The user uses графики с отступами от правого края. Сколько баров отображается на таком графике ? A pure geometric constant, independent of periods, history, scrolling and everything else.
And if you think about it?
Suppose the chart is scrolled to the right as much as possible, then the indentation is visible and there are, for example, 100 bars on the chart.
But if we scroll the chart to the left to indent it will show 100 + as many bars as fits into the indent.
 
Suppose the chart is scrolled to the right as much as possible, then the indentation is visible and there are, for example, 100 bars on the chart. <br/ translate="no"> But if we scroll the chart to the left to indent it, there will be 100 + as many bars as the indentation allows.


It is not interesting to rewind the chart by hand.


Which system functions and libraries need to be connected to
- get vertical and horizontal size of the current chart in pixels;

1. GetClientRect from user32.dll


I am not experienced in importing *.dll.
I found a description of GetClientRect

The GetClientRect function retrieves the coordinates of the working area of the window. The work coordinates define the top left and bottom right corners of the workspace. Since the work coordinates are relative to the top-left corner of the window's workspace, the coordinates of the top-left corner are (0,0).
Syntax
BOOL GetClientRect
(
HWND hWnd, // window descriptor
LPRECT lpRect // address of work coordinate structure
);
Parameters
hWnd
Identifies the window whose work coordinates are to be returned.
lpRect
Indicates the RECT structure that accepts the working coordinates. The left and top elements are null. The right and bottom elements contain the width and height of the window.
Return values
If the function completes successfully, the return value is different from zero. If the function fails, the return value is zero. To get extended error data, call GetLastError.


In other sources this function is described as void. What to believe ?

Is it necessary to specify #import "user32.dll" to connect ?

According to some sources, the RECT structure is described in winuser.h, others in windef.h. None of these files exist on my machine.

#include <winuser.h> or #include <windef.h> ?

What should be specified as the hWnd window identifier ?

How to get the required parameters from the lpRect structure ? MQL4 does not support complex data types (structures).


What system functions and libraries should be connected to

- get maximum and minimum apparent quotes of the current chart;

Maybe it makes sense to complement MQL4 language with appropriate functions ?




|------------------------------------------------| <- 1.8595
|................................................|
|................................................|
|.............--- High ........................|
|................................................|
|................................................|
|................................................|
|................................................|
|................................................|
|................................................|
|............................--- Low..........|
|................................................|
|................................................|
|----
 
Dear developers !

Please answer my questions.
 
Programming issues are discussed in the specialised MQL4.COMmunity forum.

There are many articles and a collection of programs on the site. Do not hesitate to read them. In particular, the question of minimum and maximum quotes has been discussed here: "MQL4: Interception".

I quote from
===
If you know the size of the window in pixels, you can easily use the BarsPerWindow and FirstVisibleBar functions. There is no problem to calculate the number of the bar.
It is more complicated with the price coordinate. If the scale is automatic, we can calculate it by adding 5% of the difference between the maximum and minimum price values at the top and bottom. If the scale is fixed, it cannot be calculated as there is no information about the upper and lower limit.
===
 
<br / translate="no"> I'll quote
===
If you know the size of the window in pixels, then you can easily use the BarsPerWindow and FirstVisibleBar functions. There's no problem figuring out the bar number.
It is more complicated with the price coordinate. If the scale is automatic, we can calculate it by adding 5% of the difference between the maximum and minimum price values at the top and bottom. If the scale is fixed, it cannot be calculated as there is no information about the upper and lower limit.
===


Real example: EURUSD, M1
High 1.2613 Max visible value 1.2620 delta 0.0007
Low 1.2602 Min 1.2600 delta 0.0002 visible value

Where is 5% ?

The GetClientRect search in MQL4.COM forum produces 2 references. No specific answers or recommendations.
 
<br/ translate="no"> A search for GetClientRect in the MQL4.COMmunity forum gives 2 references. No specific answers or recommendations.

So you ask a question. I invited you to a specialized forum for that purpose.
Besides, I quoted myself: "It's more complicated with the price coordinate". Which means that the question does not have an unambiguous answer.

By the way, 5% is not the price, but the number of pixels between the maximum and minimum price.
 
Only the High and Low prices are yet available to the user. According to the example above, text objects can only be displayed on 50% of the chart area. Is this normal?
 
<br / translate="no"> So you ask a question. I invited you to a specialized forum for that purpose.
Besides, I quoted myself: "It's more complicated with the price coordinate". Which means that the question does not have an unambiguous answer.

By the way, 5% is not the price, but the number of pixels between the maximum and minimum price.


I followed your advice and posted your question in MQL4.COM forum. I got zero response and no response and no hope. Please help.
 
Dear developers !

Please help me with the GetClientRect function from user32.dll to get the vertical and horizontal size of the current chart in pixels.

The description of the function is given above.

To connect it, specify #import "user32.dll".

As the identifier of the window hWnd we indicate the value returned by the function WindowHandle (...) .

How to get the required parameters from the lpRect structure, if MQL4 does not support complex data types (structures) ?
 
Dear developers !

I have been asking for help in solving my problem for more than a month without success.

Some posts get a reply after an hour or two, some are blatantly ignored for a long time. Why?
Reason: