There is a way to initialize an external datetime variable with the current time ?
I'm try something like this:
extern datetime fundamental = TimeCurrent();
But returns me the following error: 'TimeCurrent' - constant expected
I need to show the current time, not 1790.01.01 00:00
Declare the variable Globally, then give it the value in init.
Be aware though, if the EA/indicator is attached to a chart when starting MT4, TimeCurrent may be wrong.
I need it just to show an actual date on Indicator properties window, not oldest date... run it as you say still show 1970.01.01 00:00 on the properties page. See:
Sorry, I misunderstood. You want to be able to change it?
I don't think it's possible to have it default to TimeCurrent()
As an user, i hate it... just imagine 10 datetime fields that you need to change all of them manually from 1970 to now...
As an developer, Thinking in a good user experience, i think if i solve this issue will be a good idea to make the users more happy
Sorry for my bad english! Using google translator!
extern string begin = "TODAY"; // YYYY.MM.DD [HH:MM]
datetime when = (date == "TODAY") TimeCurrent() : StringToTime(begin);