Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1182

 
Igor Makanu:
Vladimir Karputov:

Thank you)

 

Can you advise whether it is possible to switch profiles in MT5 programmatically? For example, MT5 is running on a separate monitor and I need it to automatically switch a dozen different profiles in a circle at a certain interval.

Strictly speaking, the profiles are the same, only currency pairs change. The idea is that in any situation, you can quickly see on which pair the required set-up is formed.

 

There is a profile menu:


Next profile- Ctrl+F5, Previous profile- Shift+F5.


You could probably simulate pressing buttons at a certain interval.
It should not be too difficult. Is it possible to do this?
 
Agat:

There is a profile menu:


Next profile- Ctrl+F5, Previous profile- Shift+F5.


You could probably simulate button presses at a certain interval.
Shouldn't be too difficult. Can this be implemented?
None of this is necessary.
There is a standard function that sets the graphic symbol and period.
 

Each profile has 20 small windows, each with a couple of simple indicators. When switching the profile, it takes about 5 seconds to render it.
I.e. it is possible to write a simple Expert Advisor, which will periodically change the symbol in all windows simultaneously?

There's also a big test marker with the name of the symbol on it, so you can see it from afar. Will the text in it also be able to be changed at each switch?
 
Agat:

Each profile has 20 small windows, each with a couple of simple indicators. When switching the profile, it takes about 5 seconds to render it.
I.e. it is possible to write a simple Expert Advisor, which will periodically change the symbol in all windows simultaneously?

There's also a big test marker with the name of the symbol on it, so you can see it from afar. Will the text in it also be able to be changed at each switch?
Yes
 
That's great. Thank you!
 

Phew.

Please explain to a fool:

Why Period() between 1- to 30-min timeframe gives the number of minutes,

but starting from 1H it gives numbers starting from 16385 ?

(just in case, maybe it is a mistake?;
but if it is not, at least give me a hint: what high-mindedness was the developer's idea to put this into the platform).

 
User_mt5:

Phew.

Please explain to a fool:

Why Period() between 1- to 30-min timeframe gives the number of minutes,

but starting from 1H it returns numbers starting from 16385 ?

(just in case, maybe it's a mistake?
but if it is not, at least give us a hint: in what high-mindedness did the developer have in mind to put this into the platform).

This is NOT the NUMBER OF MINUTES, unlike mql4! It is an enumeration value. See documentation.

 
Alexey Viktorov:

It is NOT a number of minutes, unlike mql4! It is an enumeration value. See documentation.

Looking at ENUM_TIMEFRAMES Period();
I guessed it was an enumeration.

But enumeration does not follow from int _Period in any way. It is an int. And the expectation from it is the same.

----

But even if it is an enumeration, what great motives does it have to enumerate 16385, -6, -7, etc.

What kind of number is that? Why not enumerate the Fibo sequence, for example? :)

And, although it's not a 4k, why not a 60?


Reason: