Start and End Date of Tester?

 

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

 
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.
 
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.

 
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.