Closing Multiple Orders

 
Can any body help me with the code needed to close out multiple trades using  one account, one expert advisor and one trade at any one time per chart. I have attached my ea so far the trouble is it will only close out trades when my take profit level or stop loss levels are reached.
 

Try this:

Attached is Script file to CloseAllTrades(). Put file in ( ...experts\scripts) folder. Drag to chart to close all trades for that currency pair.

Files:
Reason: