Download MetaTrader 5

Start and End Date of Tester?

To add comments, please log in or register
Join MQL5 Cloud Network. Improve your rating!
Clock
1183
Clock 2013.05.12 06:08 

Hi everybody,

am I the blindest guy on earth? I cannot seem to find a way to use the start and end date, that the user picked in the strategy tester, from within the code, specifically the OnTester() function.


Anyone know a simple way? Of course I can, for example, write to a file in OnInit()... but I'm sure I'm just overlooking the easy way.


Thanks,

Clock

Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2013.05.12 10:19  
Clock:

Hi everybody,

am I the blindest guy on earth? I cannot seem to find a way to use the start and end date, that the user picked in the strategy tester, from within the code, specifically the OnTester() function.


Anyone know a simple way? Of course I can, for example, write to a file in OnInit()... but I'm sure I'm just overlooking the easy way.

OnTester() is called when testing finishes. You can determine the first tick that OnTick() sees and the current tick . . . make these globally declared and you can then use them in OnTester() as the start and end dates.
Clock
1183
Clock 2013.05.12 21:05  
RaptorUK:
OnTester() is called when testing finishes. You can determine the first tick that OnTick() sees and the current tick . . . make these globally declared and you can then use them in OnTester() as the start and end dates.

Thanks! So it basically comes back to remembering the date from start, there's no way of finding it out later on.

You know, cause there's also the StartBalance which I can use anytime, I thought, StartTime might be the same.


Never mind, will do with FileWrite or Global Variable.

Simon Gniadkowski
Moderator
18001
Simon Gniadkowski 2013.05.13 00:18  
Clock:

Thanks! So it basically comes back to remembering the date from start, there's no way of finding it out later on.

You know, cause there's also the StartBalance which I can use anytime, I thought, StartTime might be the same.


Never mind, will do with FileWrite or Global Variable.

Why ?  all you need is one globally declared datetime variable.
To add comments, please log in or register