Possible bug with OnTradeTransaction event handler

Chidera Anakpe  

I've come across an issue that's a bit strange, the code below is able to tell anytime a pending order is deleted/cancelled on the chart. Outside tester the result.order field carries the ticket of the pending order that was cancelled, but if you run this same code on the strategy tester the result.order field is always equal to 0.

void OnTradeTransaction(const MqlTradeTransaction& trans,
                        const MqlTradeRequest& request,
                        const MqlTradeResult& result)
  {
//---
   if (trans.type == TRADE_TRANSACTION_REQUEST)
   {
    if (request.action == TRADE_ACTION_REMOVE && result.retcode == 10009)
    {
     Print(" Order deleted! magic ",request.magic," result ticket ",result.order);
    }
   }
  }

Is this a bug on mql5 side or am I missing something, please advice.

Chidera Anakpe  
Hi, anyone had time to look at this yet?
uriyaz  
same issue hmmm
Chidera Anakpe  
uriyaz:
same issue hmmm
Yes,  it's a clear issue,  but all of a sudden all moderators have gone mute.  Will try to post on the Russian forum, will likely get more activity there. 
501  
Chidera Anakpe #:
Yes,  it's a clear issue,  but all of a sudden all moderators have gone mute.  Will try to post on the Russian forum, will likely get more activity there. 

I also found same issue which you mention. interesting was that only Pending order delete in Test env get zero on order ticket.

https://www.mql5.com/en/forum/386661

Hope MQL will fix this issue as it is not broker depended.

Found Bug: Order ticket is zero in TRADE_TRANSACTION_REQUEST msg for Pending order delete transaction
Found Bug: Order ticket is zero in TRADE_TRANSACTION_REQUEST msg for Pending order delete transaction
  • www.mql5.com
Would like to contribute to improve MT5, where do I report found bug...