OANDA MetaTrader4 giving 2 orders in History Pool to Each Order Closed

 

Hello every1

I'm working with OANDA MT4 Ver: 4 Build 406. I have an EA that checks for closed orders in the History Pool whenever there's an order closed. Sometimes 2 new orders are spawned in the history pool for each order i close. One is the order i have closed and the other is the interest on it. This messes up all my functions. Furthermore, sometimes this happens while other times it does not. So i can not apply a specific fix for it. Can any1 please tell me why this happens? Any sort of help would be really appreciated.

Waiting for your kind replies.

Umer

 
What did OANDA say when you asked them about it ?
 
RaptorUK:
What did OANDA say when you asked them about it ?

Thank you very much for your comment.


I haven't asked them about this. Sorry about my ignorance, can you guide me?

 
Master.Aurora:

Thank you very much for your comment.


I haven't asked them about this. Sorry about my ignorance, can you guide me?

You have a Broker related question and you haven't asked your Broker ? aren't they the most likely to be able to help you ?
 
Master.Aurora:
One is the order i have closed and the other is the interest on it.
  1.     for(int iPos=OrdersHistoryTotal()-1; iPos >= 0 ; iPos--) if (
            OrderSelect(iPos, SELECT_BY_POS, MODE_HISTORY)      // Only orders w/
        &&  OrderMagicNumber() == Magic.Number                  // my magic number
        &&  OrderSymbol()      == chart.symbol                  // and my pair.
        &&  OrderType()        <= OP_SELL// Avoid cr/bal https://www.mql5.com/en/forum/126192
        ){
    
    Are you filtering.
  2. mbTrading.com states that commission field is only for a single entry, but ECN brokers have two - on open and close. Therefor they add an extra trade entry in history has a credit/debit at the time of order close.

    http://www.mbtrading.com/metatrader4.aspx FAQ states that partial fills are also possible on ECN/STP environments, resulting in multiple ticket IDs.

 
WHRoeder:
  1. Are you filtering.
  2. mbTrading.com states that commission field is only for a single entry, but ECN brokers have two - on open and close. Therefor they add an extra trade entry in history has a credit/debit at the time of order close.

    http://www.mbtrading.com/metatrader4.aspx FAQ states that partial fills are also possible on ECN/STP environments, resulting in multiple ticket IDs.


Thank you for your kind reply

For point 1, actually i'm working with order counts and decisions have to be made based on them. I am able to get the interest orders filtered out but not before i check the order counts which decide the fate of the EA. I need to try to turn them off altogether or find when they occur

Reason: