[No prices] and [off quotes] at market order

 

Hi,


I need help to understand why do I get [No prices] and [off quotes] returns when opening a position at market price, and the symbol ENUM_SYMBOL_TRADE_EXECUTION is SYMBOL_TRADE_EXECUTION_EXCHANGE.

2021.01.05 10:17:40.203 Trades  '999999': failed exchange buy 1 WING21 at market sl: 117900 tp: 118200 [No prices]

I'm using:

CTrade::Sell(const double volume,const string symbol=NULL,double price=0.0,const double sl=0.0,const double tp=0.0,const string comment="");

and setting price to 0.0


Thank you.

 

I noticed that CTrade::Sell() does not send zeroed price to OrderSend(). So it seems that it won't be an order at market price:

//+------------------------------------------------------------------+
//| Sell operation                                                   |
//+------------------------------------------------------------------+
bool CTrade::Sell(const double volume,const string symbol=NULL,double price=0.0,const double sl=0.0,const double tp=0.0,const string comment="")
  {
//--- check volume
   if(volume<=0.0)
     {
      m_result.retcode=TRADE_RETCODE_INVALID_VOLUME;
      return(false);
     }
//--- check symbol
   string symbol_name=(symbol==NULL) ? _Symbol : symbol;
//--- check price
   if(price==0.0)
      price=SymbolInfoDouble(symbol_name,SYMBOL_BID);
//---
   return(PositionOpen(symbol_name,ORDER_TYPE_SELL,volume,price,sl,tp,comment));
  }

Thank you.