Capture Current Time In Variable
-
I can easily display the current time in real-time using fxDreema built-in functions which are great.
However trying to capture the current time, place it into a variable or constant and then use it later as a value in something like Bucket of Closed Positions or even display it is something I have been unable to do.
I can end up with a value like 1652845765.0 but don't know what to do with that?
Any help appreciated.
-
@raveon That value is the seconds after 1970, you can see how to do it here: https://fxdreema.com/shared/kcFzx8a5b
-
Thank you very much very helpful. I have copy/pasted the code block you provided and have created some of the variables as "double" types successfully. However, I still get a compilation error when trying to declare some of them.
TimeToStr
TimeLocal
TimeCurrent
TimeGMTI have tried them as double, string, and even tried datetime variable types with no luck. (MT5). Can you help a little furher?
Thank you again
-
Shouldn't it be int? Double has decimal place, int are only whole numbers, which is how time is processed afaik
-
@general-melchett Correct. It should be of an int type.
-
@raveon said in Capture Current Time In Variable:
TimeToStr = int to string
TimeLocal = string
TimeCurrent = string
TimeGMT = string -
Thank you all. Very helpful. Will be giving this a shot.