Hi guys,
in order to measure lenght of backtest and compute one time related performance index I tried this code (without success..)
hstTotal => total number of order in history
for(i=0; i<hstTotal; i++)
{
if (OrderSelect(i,SELECT_BY_POS,MODE_HISTORY))
{
datetime ctm1,ctm2;
// catch first order date on history..
if(i==0) ctm1=OrderOpenTime();
// catch last order close date on history and print result..
if(i==hstTotal-1) {
ctm2=OrderCloseTime();
Print("Total Backtest Days => ", (ctm2-ctm1)/86400);
}
..
But this code - built inside OnTester() function - dont return right values..
Anyone know how to solve this ?
Thank you in advance
maurizio
in order to measure lenght of backtest and compute one time related performance index I tried this code (without success..)
hstTotal => total number of order in history
for(i=0; i<hstTotal; i++)
{
if (OrderSelect(i,SELECT_BY_POS,MODE_HISTORY))
{
datetime ctm1,ctm2;
// catch first order date on history..
if(i==0) ctm1=OrderOpenTime();
// catch last order close date on history and print result..
if(i==hstTotal-1) {
ctm2=OrderCloseTime();
Print("Total Backtest Days => ", (ctm2-ctm1)/86400);
}
..
But this code - built inside OnTester() function - dont return right values..
Anyone know how to solve this ?
Thank you in advance
maurizio