Hi all, is it possible to save a global variable as datetime format?
I'm trying with the following code, but I see it as a string.
This way ?
TimeToString - Conversion Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5

- www.mql5.com
why not just make the datetime variable global and then use TimeToString function inside GlobalVariableGet
what?
global variables are a string name with a double value, the OP clearly wants to be able to store and recall a datetime and therefore needs to cast to/from the double value, the string value will be needed to set/get the global variable.
what?
global variables are a string name with a double value, the OP clearly wants to be able to store and recall a datetime and therefore needs to cast to/from the double value, the string value will be needed to set/get the global variable.
Actually, just make a global string variable. Cast the datetime to a string. Job sorted. I don't know why you need double variable when he needs a date
Read carefully the documentation. There is ONE possibility here using
GlobalVariableSet
Variable Name as String and a Double value... make your magic happen converting the double to what you really want...
OR, make use of saving/reading Terminal text files...
;)
Read carefully the documentation. There is ONE possibility here using
Variable Name as String and a Double value... make your magic happen converting the double to what you really want...
OR, make use of saving/reading Terminal text files...
;)

- 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 all, is it possible to save a global variable as datetime format?
I'm trying with the following code, but I see it as a string.