下载MetaTrader 5
要添加评论,请登录注册
您想要学习MQL5吗?300篇文章将有助于您!
gget
410
gget 2008.03.05 18:44 

Hi ! Mr. Rosh

I found Demo Test is very defferent from Back Test !

An ea operates very good in Back Test but Ii's failure in Demo Test

For example :

Using OrderModify(....) is very successful in Back Test

But it does not work at Demo

It seems your Server (MetaQuotes' Server) refuse acception the OrderModify(....)

It look like the server jump over the OrderModify(....) to next instruction !

Mr. Rosh,

1. How to make sure the Server to accept the OrderModify(....) ?

2. How to know the Server is to execute it already ?

Please help me !

Thank you in advance !

Rashid Umarov
管理员
6600
Rashid Umarov 2008.03.06 10:26  
You have to check result of function OrderModify(). If result is true - all right. Otherwise you have to get error code with GetLastError() and handle it.
gget
410
gget 2008.03.06 17:14  

Thank you for responsed my question !

Well,I can use the cycle to force the server trying "the modify" again and again until "the modify" successfully

like this :

......

while(OrderModify(...))

{

Sleep(1000);

}

.....

It's OK ?

Rashid Umarov
管理员
6600
Rashid Umarov 2008.03.06 17:24  
I don't see handling of OrderModify(). It is unsafe code. This is more correctly one:

int try=0;
bool result;
while(try<5)
  {
   RefreshRates();
   result=OrdersModify(...);
   if (result) break;
   if (!result)
      {
      int err=GetLastError();
      Print("OrderModify failed with error code=",err);
      if (error is critically) break; 
      }
  try++;
   Sleep(1000);
  }
gget
410
gget 2008.03.06 17:33  

Thank you so much !

I will try this and report thr result !

gget
410
gget 2008.03.10 04:00  
/
要添加评论,请登录注册