新手求助 MT5 上市价成交的问题

 

写了个EA,回测运行时总是报 requote 4756 重新报价的错误。

这是下单代码:

      ulong spread = 5;
	request.action=TRADE_ACTION_DEAL;         // 设置挂单 
      request.magic=magicNum;                  // ORDER_MAGIC 
      request.symbol=symbol;                      // 交易品种 
      request.volume=lots;                          // 0.1为单位的交易量 
      request.sl=slPrice;                                // 没有指定止损价位 
      request.tp=tpPrice;                                // 没有指定盈利价位 
      request.type=ORDER_TYPE_BUY;                // 订单类型 
      request.price=ask;  // 
      request.comment= comment;
      request.deviation=spread;  
      request.type_filling = ORDER_FILLING_IOC; 
   
      MqlTradeResult result={0}; 
      
      if(MyOrderSend(request,result)){
         ticket = result.deal;
         openPrice = result.price;
         PrintFormat("BUY order opened price: %.5f ticket:%d",openPrice,ticket);
         
      }else
         Print("Error opening BUY order : ",GetLastError());

报错:

2020.12.17 21:03:31.513 2020.12.16 08:15:46   requote 1.19103 / 1.19112 / 1.19103 (instant buy 0.01 GBPCHF at 1.19115)
2020.12.17 21:03:31.513 2020.12.16 08:15:46   request.price = 1.19115   result.ask = 1.19112 result.bid = 1.19103

意思是我用1.19115 去下市价多单,但是现在Ask 变成了 1.19112,可成交价更低了,按道理应该给我成交啊,况且还设置了deviation = 5 。

如果在mt4里面应该是立马成交的。

请问应该怎样处理啊