Download MetaTrader 5

How to initialize extern datetime with current time? - page 2

To add comments, please log in or register
whroeder1
16104
whroeder1  
Why not? User can enter any datetime and it works fine. If you want a calendar pop up, you're going to have to have a GUI coded.
Wemerson Guimaraes
627
Wemerson Guimaraes  
WHRoeder:
Why not? User can enter any datetime and it works fine. If you want a calendar pop up, you're going to have to have a GUI coded.
The reason is because i need to make things easy for users... just that!
cooper47
7
cooper47  

Use this code


extern datetime t = D'';
Alain Verleyen
Moderator
33501
Alain Verleyen  
cooper47:

Use this code


Nope. This will initialized the parameter with compilation date, not current time.
Daniel Lewis
94826
Daniel Lewis  
Alain Verleyen:
Nope. This will initialized the parameter with compilation date, not current time.

 

Try this

input datetime DT = D'00:00';
It will put you on current date at midnight
Alain Verleyen
Moderator
33501
Alain Verleyen  
Daniel Lewis:

 

Try this

It will put you on current date at midnight

Try it tomorrow.

Maybe I was not clear enough ? Using this

extern datetime t = D'';

or this

input datetime DT = D'00:00';

or whatever other way you could find to express it, will use the compilation date. Of course, today, you compile, so it's the same, but on the future it will be the same date, I mean the compilation date which will not be any more "today" (the day you run it).

12
To add comments, please log in or register