Close Order Muiltiple same pair buy and sell in mt5

 

hi

  i tried but failed . i know how to close without hedgeing broker order in m5. but i cannot able to close order with allowed hedgeing in mt5 broker. any one can help me in this

 
Muhammad Mudasir:

hi

  i tried but failed . i know how to close without hedgeing broker order in m5. but i cannot able to close order with allowed hedgeing in mt5 broker. any one can help me in this


CTrade.PositionClose
 
Vladimir Karputov:

CTrade.PositionClose
Thank and is partial close by ordersend
 
Muhammad Mudasir:
Thank and is partial close by ordersend

CTrade.PositionClosePartial
 
Vladimir Karputov:

CTrade.PositionClosePartial
Thabk you very much
 
Muhammad Mudasir:
Thabk you very much


Just in case: class CPositionInfo - search of all positions

   for(int i=PositionsTotal()-1;i>=0;i--) // returns the number of open positions
      if(m_position.SelectByIndex(i))     // selects the position by index for further access to its properties
         if(m_position.Symbol()==m_name && m_position.Magic()==m_magic)
            {
             ...
            }
m_name - the name of the necessary symbol.