Does manual orders have magic number?

 

Hi guys,

I use the following loop in order to cycle my orders and close all orders in the same symbol and magic number.

for(cnt=0;cnt<OrdersTotal();cnt++)   {
     if (OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES)){
           if (OrderSymbol()==Symbol() && OrderMagicNumber() == MagicNumber){           
               ...

This way i managed to run the EA on all currency pairs at once, and in addition trade manually, all in one account.
First time today, i had 2 manual orders closed out of the blue. They didn't reached TP or SL.
So two guesses left:
1. My EA closed it somehow.
2. I need to change broker as he tries to fail me.

If 1st true, then that means that the manual orders had the same Magic Number as the auto trades had.

Is it possible?

 
Manual orders have a magic number of zero. If that's what used as a magic number...
 
As far as I can tell, manual orders Do Not have Magic Numbers unless you assign one. It might be possible that it's assigned magic number 0 by default. If your EA magic number is 0 also then that could be the problem. If you hover over your orders in History, it'll tell you the magic numbers. I'll also recommend writing a script which would cycle through the orders in History and Print the magic numbers.
 

Weird, my magic number is not 0.

I'll keep looking what happen..

Thanks !

 
msbusinessil:

Hi guys,

I use the following loop in order to cycle my orders and close all orders in the same symbol and magic number.

This way i managed to run the EA on all currency pairs at once, and in addition trade manually, all in one account.
First time today, i had 2 manual orders closed out of the blue. They didn't reached TP or SL.
So two guesses left:
1. My EA closed it somehow.
2. I need to change broker as he tries to fail me.

If 1st true, then that means that the manual orders had the same Magic Number as the auto trades had.

Is it possible?

those orders must have been opened by the EA, since they were closed. Orders do not close unless the magicnumber and symbol match.
Reason: