Questions from Beginners MQL5 MT5 MetaTrader 5 - page 845

 
MrVIS:

I would like to get something similar to the one shown in the screenshot. However, I can't figure out what parameters to set to get an analogue to the terminal settings "Settings/Graphics/Precise timeline" and how to set the anchor points to the coordinates between the bars.

You cannot draw between bars, only on bars. In your case, "Trend line" will do

 
Vitaly Muzichenko:

You can't draw between the bars, only on the bars. In your case, the "Trend Line" will do.

Thank you, Vitaly. I have the same opinion. Objects that have anchor point coordinates that coincide with bar coordinates can be drawn only on bars (e.g., "trend line"). However, I really want to be wrong about it :). That's why I asked the question on the forum. In order to draw a vertical line between bars, I currently see two ways. Both are related to using the pixel coordinates of the window. The first is to apply a rectangular marker for this purpose. This is where I started the discussion on this topic. The second, suggested by Artem Trishkin, thank you for that, is to use a canvas. Unfortunately, both methods are computationally intensive. Thanks to everyone who responded to my question.

 
MrVIS:

To draw a vertical line between bars...

Go into settings and check this box. That's it, now all vertical lines that you will create through MQL will not be linked to bars.

How it is possible not to see the full-fledged answer to your question - I do not understand.

SZY: Here is an animation where in the upper window the brown rectangle boundaries (standard object) between bars are moving programmatically.

 
fxsaber:

Go to the settings and check this box. Now, all vertical lines created in MQL will not be linked to bars.

I don't understand how you can ignore a full-fledged answer to your question.

HH Here is an animation where in the upper window the brown rectangle boundaries (standard object) between bars are moving programmatically.

Thanks, fxsaber. Very much appreciate your clarification. Sorry, I didn't immediately realize that it is possible to set the anchor points to values that don't coincide with the time of a particular bar. Maybe, can you also suggest how to enable the"Precise time scale" option in MQL5?

 
MrVIS:

How can I set the"Precise timeline" checkbox from under MQL5?

You can't. This is a setting of the whole Terminal.

 

Question:


In MT5, in the tester, when I click in OBJ_EDIT after entering text, it disappears.


Is this normal behaviour?

I have already been told that the graphics in the tester do not work

 
Sergey Likho:

Question:


In MT5, in the tester, when I click in OBJ_EDIT after entering text, it disappears.


Is this normal behaviour?

I have already been written that the graphics in the tester do not work

Quite. You don't need to click in the tester in the "Input field" =)

 

Help)

There are some variables like Symbol_1, Symbol_2 etc. I want to loop through them.

Tried the code:


     for(int i=1;i<NUMBER_OF_SYMBOLS+1;i++)
     { 
         string s=("Symbol_"+IntegerToString(i));
         SomeFunc(s);
     }

But it doesn't work. s contains text Symbol_1, Symbol_2 and I need variable value with name Symbol_1, Symbol_2 etc.

How can I convert a string to a variable value with this name?



 
xFFFF:

Help)

There are some variables like Symbol_1, Symbol_2 etc. I want to loop through them.

I tried the code:


But it doesn't work. s contains text Symbol_1, Symbol_2 and I need variable value with name Symbol_1, Symbol_2 etc.

If you want a variable value, then assign directly:

string s = Symbol_1;

Why such a detour?

How can you convert a string to a variable with this name?

You can't.

If you have multiple variables that need to be queried in a loop, you create an array, not multiple variables.

 

Can you tell me if this is profiling?

What consumes so much, the type conversion, or the return itself?

Reason: