Dear Mr.Rosh, another serious confusion

 

Dear Mr.Rosh,

Serious confusion between Bscktest report and Data from history pool

I insert a piece of program like this into an ea:

int i =0;
while (OrderSelect(i,SELECT_BY_POS,MODE_HISTORY) ) i++;
OrderSelect(i-1,SELECT_BY_POS,MODE_HISTORY);

FileWrite(RFhandle,"Order: ",OrderTicket()+1," CurTime()=",TimeToStr(CurTime()));

try got the orders from history pool to do something.

The results are totally different from the Bscktest report

Please see the two Charts

according the Bscktest report :

according to the History pool The order No. like these:

Please do something

 
Well, in first try this modification:

int i =0;
while (OrderSelect(i,SELECT_BY_POS,MODE_HISTORY) )  i++;
Print("i=",i," , oredrs in history ",OrdersHistoryTotal());
OrderSelect(i-1,SELECT_BY_POS,MODE_HISTORY);
 
if (OrderSelect(OrderTicket()+1,SELECT_BY_TICKET))
{
FileWrite(RFhandle,"Order: ",OrderTicket()+1," CurTime()=",TimeToStr(CurTime()));
}
else Print("Oooops, order ticket#",OrderTicket()+1,"does'nt exist!!!");
and see Tester's log.
 

Dear Mr.Rosh

First of all,Thanks a lot for your answering.

I follow you instruction and run your modified program.

But still have some problems.

To make things simple,discussing one problem one time.

I understand that an order appeared at the history pool only afer it's colsed.

If an order appears at the history pool before it's closed time,the wrong thing happens!

Let us see the backtest reportas following

The order No.1 opened at 2006.04.17 02:15 and closed at 2006.05.11 03:50

But if run your modified program, the wrong err still happend !

THe order No.1 come to the history pool very early at 2006.04.17 02:20

We can see the results from the history pool ,look the chart

here the order No.2 should be the order No.1

I think some thing should be changed to make the closed order comes to the history pool only after the time of its closed !

 
Where you saw that "order appears at the history pool before it's closed time"? See my back test , here is order #120 :



Order 120 opened at 2007.06.15 03:50 and closed at 2007.06.15 08:07


We can see log on this period.




You try select in history order which doesn't exist yet.
 
When order #121 buy limit was opened you think you operated with order#120 though you have order #121. Do you understand me?
原因: