
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Now, unlike MT4, the period does not mean the number of seconds in a period.
It never showed the number of seconds, even in MT4 dear... But the minutes in MT4 it showed clearly. What does _Period on H1 chart show then? Seems like a serious bug to me.
Read carefully, I wrote about _Period, not about PeriodSeconds. And do not clog the page with your perception errors, please.
So H1 = 16385 is not nonsense, it is the numeric representation of H1 in ENUM_TIMEFRAMES.
Read Period-u help
Period
Returns the timeframe value of the current chart.
ENUM_TIMEFRAMESPeriod();
Returned value
Contents of the _Period variable, holding the timeframe value of the current chart. Value can be one ofthe ENUM_TIMEFRAMESenumerationvalues .
PS
Thus,it returns not the number of minutes corresponding to the period (as it was in MT4), but the element of the enumeration ENUM_TIMEFRAMES(or its numeric representation, if necessary)...
Already corrected. The general point is, using PeriodSeconds we get exactly seconds in a period, and then do whatever you like with them...
So H1 = 16385 is not nonsense, but a numerical representation of H1 in ENUM_TIMEFRAMES.
So, if I request _Period on H1 and get this ENUM_TIMEFRAMES= 16385, how can I get minutes from it?
Although, of course, divide PeriodSeconds()/60 is not worth anything. But what are these identifiers and how to work with them?
So, if I request _Period on H1 and get this ENUM_TIMEFRAMES= 16385, how can I get minutes from it?
I've been using this function in my migration library for 11 months and it worked fine so far
ANG3110:
Although, of course, you should divide PeriodSeconds()/60 by itself. But still, what kind of identifiers these are and how to work with them.
This question can be referred to the basics of OOP. It concerns identifiers and enumerators. Please refer to the Reference or any good books on C++ programming for details.
This has already been implemented in MQL4, but not so obvious.
Each identifier (whether written in MQL5 or created by user) can have its own "number representation".
To put it simply (I'm explaining it as best I can)...
You may think it's for external environment compatibility, e.g. DLL or another one (that has no idea about MQL and its identifiers).
So, if you need to work with a period inside MQL5 program, it would be reasonable to use identifier PERIOD_H1 of enumeration ENUM_TIMEFRAMES.
But if you need to tell the external environment (for example DLL) that we are working with period H1, it is easier to do with numerical representation of this identifier, in our case it is 16385.
So, if I request _Period on H1 and get this ENUM_TIMEFRAMES= 16385, how can I get minutes from it?
Although, of course, I should divide PeriodSeconds()/60. But what are these identifiers and how should I work with them?
like this
I have been using this function in my migration library for 11 months now, and so far it has been fine
like this
Developers.
1. OHLC string starts winking under some conditions. Revealed when testing EA on single core computer (CPU probably overloaded)...
2. Is it possible to place the list of classes and their functionality (the stuffing) in the navigator, just like it is done in Delphi (because it is not very convenient to work with the list of procedures and functions of a module)?
Attempted to save tester report in Open XML format. Minutes of waiting (Pentium 4, 3.0GHz), application not responding, terminal.exe process was running rampant in task manager (about 50% of CPU) eating up RAM (about 250Mb), Result - nothing. MT5 only responds, no quotes coming in (connection status indicator with grey spinning circle). A second try, it is the same. The window "Tools" has 2 journal entries "MemoryException 107878464 bytes not available", the time corresponding to the attempt to receive a report in OpenXML.
The HTML file was generated almost instantly (about 12 Mb). It takes a long time to open, but it's not MT5's fault...