Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1116

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
The help says that the timeframe value should be returned, not the identifier converted withEnumToString()
The _Period variable returns int.
ENUM_TIMEFRAMES Period() also implies int is returned.
You are the only one who implies it. Actually Period() returns the value of enum_TIMEFRAMES.
If you print out the values of constants in this enumeration, you will see numbers you are already familiar with.
And it's always been like this. It's been like this since the birth of MQL5.
And it's clearly written in the help what is returned:
Value can be one of values of enumeration ENUM_TIMEFRAMES.
You are the only one who implies this. In fact, Period() returns the value of ENUM_TIMEFRAMES enumeration.
If you print out the values of constants in this enumeration, you will see numbers you are already familiar with.
And it's always been like this. It's been like this since the birth of MQL5.
And it's clearly written in the help what is returned:
What type do you think the ENUM enumeration returns?)
And the reference clearly states
Returns timeframe value of the current chart.
Print it on your own
And the ENUM enumeration what type do you think it returns ?))
And the reference clearly says
Returns timeframe value of the current chart.
Print your own.
What do you want to prove to me?
I am perfectly aware of what is being printed and what data is being returned, when and where.
You want the number of minutes of the current period?
Get it this way:
or like this:
Or like this:
What do you want to prove to me?
Nothing to you, I didn't write to you about the problem, I wrote to the developers.
Print more on M30, and on H1 and see the difference.
You don't care, I didn't write to you about the problem, I wrote to the developers.
Print more on M30, and on H1 and see the difference.
It's not a problem. It never has been.
Forum on trading, automated trading systems and trading strategy testing
Bugs, bugs, questions
Artyom Trishkin, 2020.04.09 22:11
What do you want to prove?
I have a good understanding of what is printed and what data is returned, when and where.
You want the number of minutes of the current period?
get them this way:
or like this:
or like this:
You don't have to, I didn't write about the problem to you, I wrote it to the developers.
Print more on M30 and H1 and see the difference.
Can't you get away from MQL4?
Do it in MQL4 like this:
or like this:
Or like this:
And print out the resulting values.
Can't you get away from MQL4?
Do it in MQL4 like this:
or like this:
or like this:
and print out the resulting values.
I haven't used mql4 )) and I didn't get used to it.
Why do you have to divide by 60 more?
Where does it say that in the help?
It's already your crutches that bypass the bug.
Now check your crutch, on all timeframes
I haven't used mql4 )) and I didn't get used to it.
Why do you have to divide by 60 more?
Where does it say that in the help?
It's already your crutches that bypass the bug.
Variable _Period and Period() function up to and including M30, displays a value in minutes.
If period M1 then 1
If period M2 then 2
...
If period M30 then 30
It is logical that hourly period will be 60
two hour period 120
three hour 180
etc.
But from H1 onwards the wrong values are displayed.
if the program outputs "wrong values", you need to see what the program "thinks", but it can only think in binary format
I checked it, and it did:
2020.04.10 00:38:57.118 tst (EURUSD,H1) 0
2020.04.10 00:38:57.118 tst (EURUSD,H1) 1
2020.04.10 00:38:57.118 tst (EURUSD,H1) 10
2020.04.10 00:38:57.118 tst (EURUSD,H1) 11
2020.04.10 00:38:57.118 tst (EURUSD,H1) 100
2020.04.10 00:38:57.118 tst (EURUSD,H1) 101
2020.04.10 00:38:57.118 tst (EURUSD,H1) 110
2020.04.10 00:38:57.118 tst (EURUSD,H1) 1010
2020.04.10 00:38:57.118 tst (EURUSD,H1) 1100
2020.04.10 00:38:57.118 tst (EURUSD,H1) 1111
2020.04.10 00:38:57.118 tst (EURUSD,H1) 10100
2020.04.10 00:38:57.118 tst (EURUSD,H1) 11110
2020.04.10 00:38:57.118 tst (EURUSD,H1) 10000000001
2020.04.10 00:38:57.118 tst (EURUSD,H1) 100000000000010
2020.04.10 00:38:57.118 tst (EURUSD,H1) 100000000000011
2020.04.10 00:38:57.118 tst (EURUSD,H1) 100000000000100
2020.04.10 00:38:57.118 tst (EURUSD,H1) 100000000000110
2020.04.10 00:38:57.118 tst (EURUSD,H1) 100000000001000
2020.04.10 00:38:57.118 tst (EURUSD,H1) 1000000001100
2020.04.10 00:38:57.118 tst (EURUSD,H1) 100000000011000
2020.04.10 00:38:57.118 tst (EURUSD,H1) 100000000001
2020.04.10 00:38:57.118 tst (EURUSD,H1) 1100000000000001
facepalm ...
Really sleeve...
Print on different timeframes.