Close Positions on a Specific Sybmol Only

 

Hi,

I want to be able to close a trade on a specific symbol. All the scripts I try close positions on all open positions, irrespective of symbol.

I tried to force the script to work on only a specific symbol by changing OrderSymbol() to "EURUSD" for example. But no joy! Still closes everything.

Attached is a simple close script. How can I make it close a specific symbol only?

Thanks for any help !

Joe

Files:
 
Close all orders for Symbol - How to fix a single OrderClose function?
Close all orders for Symbol - How to fix a single OrderClose function?
  • 2018.09.09
  • www.mql5.com
I was using this function to close all opened orders for one symbol  if profit > xxx but the problem it close some of orders then the profit be