When a position is closed in one symbol, positions in another symbol are also closed.

 
Hello,
I have written an Expert Advisor in MQL4. I run this EA on two symbols simultaneously. When a position is closed on one symbol, positions on other symbols are also closed. What solution is there for this problem?
I should mention that I have used different magic numbers for each symbol.
 
hassan atarod:
Hello,
I have written an Expert Advisor in MQL4. I run this EA on two symbols simultaneously. When a position is closed on one symbol, positions on other symbols are also closed. What solution is there for this problem?
I should mention that I have used different magic numbers for each symbol.

fix your code, select by symbol and magic number

 
amando #:

fix your code, select by symbol and magic number

I appreciate your response.
Reason: