Can not close two (or more) orders simultaneously, HELP PLEASE.

 
This morning (May 12, 2005) my automated trading system wants to close USDCHF buy order 1.2149 at server time 15:30:39 and close EURUSD sell order at 1.2716 at 15:30:40. But the system only closes the USDCHF order for me. I have 2 trading systems and apply to the corresponding chart like USDCHF system to apply to usdchf chart and EURUSD to apply to EURUSD chart.

Does any body else have the same problem? Can we apply more than one system at same time on Meta trader? Any advices will be highly appreciated.

The system log shows:

06:30:39 Expert 'USDCHF': close #343496 1.00 lots at 1.2149 [slippage 4]
06:30:39 Expert 'USDCHF': ZZM-->Exiting rule 2, close buy order1.2149
06:30:39 '69722': close order #343496 at price 1.2149
06:30:40 Expert 'EURUSD': ZZM-->Exiting rule 2, close sell order1.2716
06:30:40 '69722': order #343496 closed


I use the following code to close the order:

for cnt=1 to TotalTrades {
if OrderValue(cnt,VAL_SYMBOL)=Symbol then {
CloseOrder(OrderValue(cnt,VAL_TICKET),Lots,close_sellPrice,4,Yellow );
}
}
 

I use the following code to close the order:

for cnt=1 to TotalTrades {
if OrderValue(cnt,VAL_SYMBOL)=Symbol then {
CloseOrder(OrderValue(cnt,VAL_TICKET),Lots,close_sellPrice,4,Yellow );
}
}


I am using the following logic in my EA's code to close all the open orders:

CurrentTrades = 0;
for cnt = 1 to TotalTrades
{
if OrderValue(cnt,VAL_SYMBOL) = Symbol then
{
CurrentTrades = CurrentTrades + 1;
}
}

for cnt = 1 to TotalTrades
{
if CurrentTrades <> 0 and OrderValue(cnt,VAL_SYMBOL) = Symbol then
{
.
.
CloseOrder(...........);
Exit;
}
.
.
.
}


With the above logic, you are tagging a flag (CurrentTrades) to each symbol. So far I haven't seen any problem. Hope it helps.

///Frank
Reason: