Questions about MQL4. - page 5

 
SKif:

Information processing based on BarsPerWindow( ) is the only thing I can imagine for such a purpose. But it's kinda cumbersome. .
This is really the only way. but not so cumbersome - only 2 calls: Highest and Lowest. Initial bar is calculated like this: FirstVisibleBar()-BarsPerWindow()
 
stringo,
thanks for the confirmation. That's roughly what I was planning to do.

To that, another question:
Is there any way to convert OBJ_LABEL coordinates in pixels to price and time coordinates? I'm mostly interested in the price. Can you please give me some idea. (Or have I looked at the in-house solution?
 
Is there any way to know the size of the window in pixels?
 
SKif:
Is there any way to find out window size in pixels?
In theory, yes. using the WindowHandle(Symbol(),Period() function, take the handle of the current window and give this handle to your dll, which can find out the size of the window, for example using the GetClientRect function
 
stringo,
OK, thank you.
 
Is it correct to assume that when the trend is shifted to the left so that the un-trended future time is shown on the right side:
the future time value relates to the value of the time visible on the screen as a certain % value, and when the window is resized this % is maintained?
Or is there some other pattern?
 
SKif:
Is it correct to assume that when the trend is shifted to the left so that the un-trended future time is shown on the right side:
the future time value relates to the value of the time visible on the screen as a certain % value, and when the window is resized this % is maintained?
Or is there some other pattern?
something like this.
To see the pattern, select the crosshair cursor and move it on the graph and on the right margin of the graph. The calculated time corresponding to the crosshair will be shown at the bottom of the graph.
 
stringo,
Thanks, that's understandable.
I was interested in the pattern in the form of a formula (exactly when you change the size of the window in the same TF).
Either X1=A*X2 or X1=A*X2+B.
Well, come on, I'll take A*X as a first approximation.
 
All objects in the configuration panel have a "Description" column.
Is this option available programmatically?
Files:
pic_2_.gif  26 kb
 
This is from the help:
bool ObjectSet( string name, int index, double value)


Changes value of object property. The function returns TRUE if successful, otherwise FALSE. To get the error information call GetLastError().

Parameters

name - The name of the object.
index - The index of the property. Can be any of the object's property indexes.
value - New value for the property.

Example

// Move coordinates first to continue area time
ObjectSet("MyTrend", OBJPROP_TIME1, Time[0]);
// set the second fibo level
ObjectSet("MyFibo", OBJPROP_FIRSTLEVEL+1, 1.234);
// adjusts the display of the object. The object will be shown on the 15-minute and 1-hour charts only
ObjectSet("MyObject", OBJPROP_TIMEFRAMES, OBJ_PERIOD_M15 | OBJ_PERIOD_H1);
And here's a piece from Stirlitz:

//+------------------------------------------------------------------+ //| поставим стрелку | //+------------------------------------------------------------------+ void SetArrow(datetime _time,double _price,string _Description ,int _arrowType, color _arrowColor) { ObjectCreate(_Description,OBJ_ARROW,0,_time,_price); ObjectSet(_Description,OBJPROP_ARROWCODE,_arrowType); ObjectSet(_Description,OBJPROP_COLOR,_arrowColor); }

_Description is the description (as far as I remember)
Reason: