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
Do it properly, use the correct variable type . . .
try to Print() it & c the difference
Raptor showed a correct way to use it. Check the documentation.
try to Print() it & c the difference
Like this . . .
Do it properly, use the correct variable type . . .
OK, i see.
Functions Time()/iTime() return type datetime. So the only proper way of using these functions is
Further, to print it out you can use
This is the only correct way, otherwise you can expect undefined behaviour in case of library/compiler change.
BUT, knowing that internal representation of this datatype is time elapsed in seconds since 1970 stored in 8 bytes long unsigned integer type, and that ulong type is 8 bytes long, you can trick it:
Unfortunately, to be sure that your program will always run, you are not allowed to do this. User should ONLY use functions defined for manipulating of datetime type.
So, where is the problem?
Traders are not programmers. They are not interested in structured or OO programming. They just want to use the simplest way to define behaviour of an EA.
Forcing strict C rules on some C like language like mql4 NOW is stupid.
Also i am not sure that forcing C++ rules (MQL5 in MT5) will result any better. Although the EA generator in MT5 doesn't look bad, IMO it is too complicated for an average trader.
Basic (language) or something alike, would be the most appropriate language in this sense.
And what now?
I don't see a good way nor simple way: the simplest solution is to learn proper C programming. Which is far more easier than C++.
Like this . . .
Thanks, after removing the double quote after index, I succeeded with this.
So, would the following be proper?
"string name" + (int)Time[index] //to name objects on my charts
or even this
StringConcatenate("string name",(int)Time[index])
Thanks, after removing the double quote after index, I succeeded with this.
So, would the following be proper?
"string name" + (int)Time[index] //to name objects on my charts
I think that would work . . . but might give a warning, maybe this is technically correct . . . even if it looks horrible.
using long or ulong instead of int doesn't giving a warning