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
How can this be? (see calculation of variable k and values of all variables in debug mode)
It's very simple. lparam is long type (integer), wdpix is int type (integer). lparam/wdpix is private long type (integer). Since lparam < wdpix, lparam/wdpix ==0.
See MQL5 Reference / Language Basics / Data types / Type conversion
How do you account for the gaps between adjacent bars on the chart?
Can you tell which Expert Advisor is running in another window?
Is it also possible to do an enumeration by enumeration
like this?
for (int i = PERIOD_M1;i<=PERIOD_D;i++)
Is it also possible to do an enumeration by enumeration
like this?
for (int i = PERIOD_M1;i<=PERIOD_D;i++)
This will not work.
About this - I should try it.
Somehow I suspect that will not work, although "theoretically" have a chance. :)
Well, I tried it.
Doesn't even want to compile.
'ForEnum.mq5' ForEnum.mq5 1 1
'i' - unexpected token ForEnum.mq5 15 25
'i' - undeclared identifier ForEnum.mq5 15 25
'PERIOD_D' - undeclared identifier ForEnum.mq5 15 42
'i' - parameter for EnumToString must be an enumeration ForEnum.mq5 15 77
4 error(s), 0 warning(s) 5 1
But it seems there is nothing illegal about it.
I tried it.
The programmer does not even want to compile.
And there seems to be nothing illegal about it.
To work with enum, you should probably add at least such functions as
enum::GetName and enum::GetValue
and foreach language construct
Then the enumeration will be automated by MQL
This, of course, works.
And what's great - it doesn't say that P is an unexpected token or undeclared identifier
And on the contrary, as a regular client it provides all the conveniences
Strange ..... ;)