How can I prevent counter-influence from pairs running the same script?

 
I wrote a script (EA) for MT4 to handle my trades.

The script intend to be general for all pairs, but currently I'm using it with EURUSD only.

As far as I've been told, I can run the same script on different windows (MT4's windows) each with it's own pair without influence from one pair to the other.

Well,
  1. I opened a second pair (AUDUSD) and run the script on its window as well.
  2. I opened a new short order on the EURUSD pair.
My script, is programed to adjust the SL when the price reaches to the appropriate gap from the open_price.
I was surprised to see that somehow, the script got the SL value from the other pair (AUDUSD) instead from the EURUSD

The LOG of the EA of the EURUSD pair showed:

AUDUSD,Daily: (SL Adj.) OrderModify #35266002,1.3952,0.9865,0,0,White

the red text, is the StopLoss value taken for the AUDUSD pair..


How can I prevent that from happening?

Does it mean that the same script (EA) can't run simultaneously on different pairs?
Must the script be duplicated and renamed (a unique script name for each pair) ?



or... ?! any other way to handle this?



Thank you,

James
 

hi, in general i script can modify any open order. You have to prevent the script inside your script to modify other symbols order()

if(Ordersymbol()==symbol())


//z