Is it possible to Comment at trade close in MT5. - page 2

 

Hi Folks, 

i am trying to achieve the same but can´t make it work. 
This is the edited Trade.mqh PositionClose Method.

//+------------------------------------------------------------------+
//| Close specified opened position                                  |
//+------------------------------------------------------------------+
bool CTrade::PositionClose(const ulong ticket,const ulong deviation, const string comment)
  {
//--- check stopped
   if(IsStopped(__FUNCTION__))
      return(false);
//--- check position existence
   if(!PositionSelectByTicket(ticket))
      return(false);
   string symbol=PositionGetString(POSITION_SYMBOL);
//--- clean
   ClearStructures();
//--- check filling
   if(!FillingCheck(symbol))
      return(false);
//--- check
   if((ENUM_POSITION_TYPE)PositionGetInteger(POSITION_TYPE)==POSITION_TYPE_BUY)
     {
      //--- prepare request for close BUY position
      m_request.type =ORDER_TYPE_SELL;
      m_request.price=SymbolInfoDouble(symbol,SYMBOL_BID);
     }
   else
     {
      //--- prepare request for close SELL position
      m_request.type =ORDER_TYPE_BUY;
      m_request.price=SymbolInfoDouble(symbol,SYMBOL_ASK);
     }
//--- setting request
   m_request.action   =TRADE_ACTION_DEAL;
   m_request.position =ticket;
   m_request.symbol   =symbol;
   m_request.volume   =PositionGetDouble(POSITION_VOLUME);
   m_request.magic    =m_magic;
   m_request.deviation=(deviation==ULONG_MAX) ? m_deviation : deviation;
   m_request.comment = comment;
//--- close position
   return(OrderSend(m_request,m_result));
  }

i also edited the Definition of the Method    

bool              PositionClose(const ulong ticket,const ulong deviation=ULONG_MAX, const string comment="");


in my code i call the function like that: 

if(trade.PositionClose(ticket, commentary)){
        Print(i, " -> ",ticket,", ", symbol," >> Position geschlossen 2155! ", commentary);
}

commentary is filled and looks good in Print but there is nothing in the commentary itself on close. 


No errors at all. code working :3 


Thank you in advance 
Best regards 
Jens