When running an EA on multiple symbols, it can cause interference

 
When running an EA on multiple symbols, it can cause interference.

Everything works fine when running an EA on a single symbol, but when it is run on multiple symbols, it creates interference and disrupts the opening and closing of trades.

What could be the reason for this? I have already eliminated the use of global variables.
 
Dao Liang Ding:
When running an EA on multiple symbols, it can cause interference.

Everything works fine when running an EA on a single symbol, but when it is run on multiple symbols, it creates interference and disrupts the opening and closing of trades.

What could be the reason for this? I have already eliminated the use of global variables.

give full description of what you mean by "interference", or no one will respond.

But if you are trading multiple pairs from a single ea, then search the website. There is many threads discussing this.

 
Revo Trades #:

give full description of what you mean by "interference", or no one will respond.

But if you are trading multiple pairs from a single ea, then search the website. There is many threads discussing this.

The same EA is loaded on multiple symbols on the same client. Symbol A opens a position, but Symbol B follows when it is not eligible. Or if symbol A closes a position, but symbol B does not meet the conditions for closing the position, it will also follow the closed position

 
Dao Liang Ding #:

The same EA is loaded on multiple symbols on the same client. Symbol A opens a position, but Symbol B follows when it is not eligible. Or if symbol A closes a position, but symbol B does not meet the conditions for closing the position, it will also follow the closed position

The problem is your EA coded poorly. You need to filter the symbol and magic No when closing the trades. Provide the code if that's not the solution.

for(int i = PositionsTotal() - 1; i >= 0; i--)
  {
   ulong ticket = PositionGetTicket(i);
   string symbol = PositionGetString(POSITION_SYMBOL);
   long magic = PositionGetInteger(POSITION_MAGIC);
   if(magic == InputMagic && symbol == _Symbol)
     {
      //Close the trade
     }
  }
 
Elvis Wangai Muriithi #:

The problem is your EA coded poorly. You need to filter the symbol and magic No when closing the trades. Provide the code if that's not the solution.

Each functional module has verification for symbol and magic. The issue of disruption occurs not only in closing trades but also in the opening signal. Some symbols that do not meet the conditions are opening trades, while others that meet the conditions are not opening trades. Additionally, if symbol A opens a trade, the existing trade for symbol B will be closed

 
Dao Liang Ding #:

The same EA is loaded on multiple symbols on the same client. Symbol A opens a position, but Symbol B follows when it is not eligible. Or if symbol A closes a position, but symbol B does not meet the conditions for closing the position, it will also follow the closed position

unless you show the code, you will not get any help. However, i do predict that your close prices are incorrect digits or something simple like that. But if you will not provide code for us to analyse, we can not help.

I suggest that you buy a developer on Freelance.

 
Revo Trades #:

unless you show the code, you will not get any help. However, i do predict that your close prices are incorrect digits or something simple like that. But if you will not provide code for us to analyse, we can not help.

I suggest that you buy a developer on Freelance.

Thank you for your concern. I've taken care of it myself

Reason: