Hi guys,
as per topic i'm total noob on mql5. Couple of years back started mql4 but dropped it so instead of continuing i decided to give mql5 a try.
I'm trying out some basic commands and came across the __DATETIME__ so I tried printing it via the below command
The command is placed in the ontick section so it should refresh with every tick, but it kinda does and does not.
it just keep repeating the same time including the second with every tick.
shouldn't it be updated with every tick since the current time is changing?
here's the print result below. EA launched at 13:10:31, that is 1.10pm, but seconds remain 31 despite real clock moved upto 39sec
I know its not the end of the world and probably I will never use this but you know...since i'm reading and trying might aswell know what's going on and why
L
Try
Print ("DateTime is ", TimeCurrent());
Read the documentation:
- https://www.mql5.com/en/docs/dateandtime/timecurrent
- https://www.mql5.com/en/docs/constants/namedconstants/compilemacros
Have fun
Matthias
![Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions](https://c.mql5.com/36/59/documentation-on-mql5-constants__3.png)
- www.mql5.com
Hi guys,
as per topic i'm total noob on mql5. Couple of years back started mql4 but dropped it so instead of continuing i decided to give mql5 a try.
I'm trying out some basic commands and came across the __DATETIME__ so I tried printing it via the below command
have a look at what __DATETIME__ is
![Documentation on MQL5: List of MQL5 Constants Documentation on MQL5: List of MQL5 Constants](https://c.mql5.com/36/59/documentation-on-mql5-list-of-mql5.png)
- www.mql5.com
Try
Read the documentation:
- https://www.mql5.com/en/docs/dateandtime/timecurrent
- https://www.mql5.com/en/docs/constants/namedconstants/compilemacros
Have fun
Matthias
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi guys,
as per topic i'm total noob on mql5. Couple of years back started mql4 but dropped it so instead of continuing i decided to give mql5 a try.
I'm trying out some basic commands and came across the __DATETIME__ so I tried printing it via the below command
The command is placed in the ontick section so it should refresh with every tick, but it kinda does and does not.
it just keep repeating the same time including the second with every tick.
shouldn't it be updated with every tick since the current time is changing?
here's the print result below. EA launched at 13:10:31, that is 1.10pm, but seconds remain 31 despite real clock moved upto 39sec
I know its not the end of the world and probably I will never use this but you know...since i'm reading and trying might aswell know what's going on and why
L