Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1183

 
User_mt5:

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 4q, why not 60?


Because _Period for mql4 compatibility. And in fact, it's the same value in a predefined variable and nothing else. If you have an irresistible desire to learn mql5, forget everything you know about mql4, forget about minutes in timeframe. Take it as it is and use it.

 
Alexey Viktorov:

Because _Period is for mql4 compatibility. In fact, it is the same value in a predefined variable and nothing else. If you have an overwhelming desire to learn mql5, forget everything you know about mql4, forget about minutes in timeframe. Take it for what it is and use it.

OK.

 
Alexey Viktorov:

Because _Period is for mql4 compatibility. In fact, it is the same value in a predefined variable and nothing else. If you have an overwhelming desire to learn mql5, forget everything you know about mql4, forget about minutes in timeframe. Take it as it is and use it.

And I agree with the formulation of the question. From Period() is expected, intuitively, at least the number of seconds. And a function which gives the result from an enumeration... is something )))

Then there's an assumption that PeriodSeconds() would be unnecessary. And it would reduce unnecessary gestures...

 
Сергей Таболин:

And I agree with the statement of the question. Period() is expected, intuitively, at least the number of seconds. And a function that returns a result from an enumeration... is something )))

Then there's an assumption that PeriodSeconds() would be unnecessary. And it would reduce unnecessary gestures...

You look like Don Quixote.

 

This is from the documentation:

ChartIndicatorAdd

Adds an indicator with specified handle to the specified chart window

ChartIndicatorDelete

Deletes an indicator with a specified name from the specified chart window

ChartIndicatorGet

Returns the indicator handle with the specified short name on the specified chart window

ChartIndicatorName

Returns the short name of the indicator by the number in the list of indicators on the specified chart window

ChartIndicatorsTotal

Returns the number of all indicators attached to the specified chart window.


How do I know if the indicator is already on the chart based on the received handle?

If ChartIndicatorName would return a short name by its handle - I see, but what about it? Go through everything in a loop?

 
Hi all. Could you please advise something similar to this --e-CloseByProfit- EA will close all positions when they reach a predefined total profit or loss level --- only on MT5. Thank you.
 

Hi connoisseurs. Can you please tell me, if in functions CopyLow,CopyHigh and similar, it is possible to take single data, i.e. from one bar, in a variable (of appropriate type), but not in array, as it is specified in documentation?

Thank you very much for the answer.

 
odyn:

Hi connoisseurs. Can you please tell me, if in functions CopyLow, CopyHigh and similar, it is possible to take single data, i.e. from one bar, in a variable (of appropriate type), but not in array, as it is specified in documentation?

Thank you very much for the answer.

You can only do this: ask for a single item, but still in an array. And after that get already values from array from index [0].

 
is it possible to work with the moscow exchange here on metatrader5
 
How to call a custom indicator from an EA? In mql4 it was done by calling iCustom().