I would like to get the optimization period (when use data is checked)
At first I tried like this.
datetime dtFrom;
datetime dtTo;
void OnInit(){
dtFrom = Time[0]; //from date
}
double OnTester(){
dtTo = Time[0]; // to date
}
However, it has problem, even if I set 2005/01/01 - 2005/01/29
by strategy tester UI dropbox.
dtFrom will be 2005/01/09
, dtTo will be 2005/01/28
in Script.
Because, 01-08 is holiday and 29 is saturday, so there is no data calculation.
And also if it has shortage of budget, run stops and dtTo
is the date when shortage happens.
Is there simple good way to get the date that User set in strategy tester box??