Maximum and minimum visible quotes

 
Dear developers !

I propose to make available for users the maximum and minimum values of visible quotes in the current chart window (on the vertical axis).

It will give an opportunity to place graphical objects in any point of the chart.

Now I determine these values using High[ ] and Low[ ] arrays.

When the market activity is low, a large part of the chart area is inaccessible. My text objects are placed on chart lines while there is an empty black space above and below. That's a shame.
 
Check statement in indicator

Comment ( " ", BarsPerWindow(), " ", FirstVisibleBar( ), " ", Bars );

Right after compilation we get 490 9104 9304.
After the first tick we get 490 409 9304.

What explains this property of FirstVisibleBar( ) ?
 
What explains the FirstVisibleBar( ) property ?

Missing bars have swollen or the graph has shifted.
 
Why is it that BarsPerWindow() does not need to swap bars?

The BarsPerWindow() and FirstVisibleBar( ) functions behave quite differently on startup.

Please give your opinion about maximum and minimum of quotes visible in the current chart window (on vertical axis).

I need it very much.
 
Two hands "For" !!!

I withdraw profit/loss orders in $ and pips directly to the chart. Everything is in front of my eyes, no need to switch my attention from the chart to the terminal. The font in the terminal is small, and there is more space on the screen without the terminal.

The BarsPerWindow() function solves all problems horizontally. Why not make similar functions in vertical direction ?

I confirm FirstVisibleBar( )'s "strangeness" at startup. Because of such "sluggishness" of FirstVisibleBar( ), I use BarsPerWindow( ), although the former would suit me better.
 
"MQL4: Storing and displaying information".

This article focuses on convenient and practical methods of storing and displaying information. Here we consider alternatives to the standard
log file of the terminal and the Comment() function.
 
Thanks, komposter !

I haven't read this article, I will definitely look into it after Trichet's press conference.

It is my firm belief that coordinates of corners of visible area are a MUST for a graphical program.

I consider BarsPerWindow() and FirstVisibleBar( ) to be the first step in this direction. Without these functions I had a lot of problems in MT3.
 
The developers know the maximum vertically visible coordinate.

Comment () is always in the top left corner.
 
Dear komposter !

Trichet has done well so far, the process is moving in the right direction.

The main idea of the article is clear to me. So far I haven't used text labels, which I regret.

I assume the top left corner of the window has coordinates in pixels ( 0, 0 ). All output is bound to the top left corner.

I need, for example, to output an object in the centre of the chart. What is the height and width of the working part of the chart in pixels ?

I'm convinced that there are special functions in Windows which define the width and height ( in pixels ) of the window as a whole.

Will definitely modify Comment () a la komposter.

Thanks !!!
 
You can't praise me too much, I get cocky =)))

I assume that the top left corner of the window has coordinates in pixels ( 0, 0 ). The entire output is snapped to the top left corner.
The output can be snapped to any corner. See help for OBJPROP_CORNER.

I need, for example, to display an object in the centre of a graph. What is the height and width of the working part of the graph in pixels ?
The screen height and width can be determined with the GetSystemMetrics function from the user32 library. I used it from VBA, but I think there shouldn't be a problem here either ;)
 
Please advise how to implement in MQL4:

- getting the vertical and horizontal size of the current chart in pixels;

- getting the maximum and minimum visible quotes of the current chart;

- get the total number of expanded charts in the window.

I need these parameters to control the display of graphical objects. Thank you.
Reason: