I have an MQL4 script ( a script that runs on MetaTrader4 Terminal platform ) and I need to define an extern
variable, named extractionDate
of type datetime
, so that the user can change its input value before the script starts.
I tried the conventional way to define the variable before the standard script's function start()
, but it doesn't work. When I compile I, get the error message
['TimeLocal' - constant expected]
that means MQL4 wants a constant value for the variable. But this isn't my goal. I would like to show as default value the "Today" date, when the script starts and not a fixed predefined date value.
Is it possible to do this or not?
extern datetime extractionDate = TimeLocal();
int start()
{
......
return(0);
}