PositionsTotal() (MQL5 code)

How should I use PositionsTotal() to return the number of operations at the symbol (chart) applied and not the total? (MQL5 code)

For several reasons I need you to be as well. I don’t want the total, as I do not wish to take into account manual trades in other symbols.

Thank you in advance.‌

int total=PositionsTotal();
   int b=0,s=0,n=0;
   for(int i=total-1; i>=0; i--)

I think PositionSelect(“the symbol you need”) will help you…

Does not work, because what true/false is returned, not the number of open positions in that time and symbol.

‌Thanks anyway. :wink:

Why people who are selling products on the Market want to get free help on the forum ?

You have never had a doubt? That lucky…

By the way…issue resolved.


      for(int i=PositionsTotal()-1; i>=0; i--)
         string CounterSymbol=PositionGetSymbol(i);

         if(Symbol()==CounterSymbol && m_position.Magic()==MagicNumber)

I was sure you will be able to find it.