Magic Number

 

Hi!

If there is no magic number, will a trade on one graph affect the other graphs. Especial  in the codebase, there will be some EA's that will have no magic numbers ?

 
Hiram Eckstein:

Hi!

If there is no magic number, will a trade on one graph affect the other graphs. Especial  in the codebase, there will be some EA's that will have no magic numbers ?

No MagicNumber means magic = 0 meaning Manual Trade

 
Fernando Morales:

No MagicNumber means magic = 0 meaning Manual Trade

But i use it as a ea. It automatically trades. I want to attach it to another forex pair. I just don't want the trades to mess with each other.
 
Hiram Eckstein:
But i use it as a ea. It automatically trades. I want to attach it to another forex pair. I just don't want the trades to mess with each other.

If a ea opes a trade it always has a magic number even iff you do not have the option to modify the magic number. But it will have magic number. Ask the coder to give you the option to modify the magic in case two EA use same magic numbers to manipulate orders it can certainly happen that an ea manipulates an order form another ea if the magic is the same or if the ea is badly coded and not distinguishing the magic number t avoid modifying order that are not his

 
Tomas Rodriguez Doherty:

If a ea opes a trade it always has a magic number even iff you do not have the option to modify the magic number. But it will have magic number. Ask the coder to give you the option to modify the magic in case two EA use same magic numbers to manipulate orders it can certainly happen that an ea manipulates an order form another ea if the magic is the same or if the ea is badly coded and not distinguishing the magic number t avoid modifying order that are not his

this errors happen when coder has no experience and does not take measures to avoid this problems or when the user enters wrong inputs

 
Hiram Eckstein:
But i use it as a ea. It automatically trades. I want to attach it to another forex pair. I just don't want the trades to mess with each other.

then put a different magic number for each pair

 
Tomas Rodriguez Doherty:

If a ea opes a trade it always has a magic number even iff you do not have the option to modify the magic number. But it will have magic number. Ask the coder to give you the option to modify the magic in case two EA use same magic numbers to manipulate orders it can certainly happen that an ea manipulates an order form another ea if the magic is the same or if the ea is badly coded and not distinguishing the magic number t avoid modifying order that are not his

 
Hiram Eckstein:
I managed to change the magic no. Using the metaeditor. 
Thanks
 
Hiram Eckstein: I managed to change the magic no. Using the metaeditor. 
That still means the EA might be incompatible with itself, if it doesn't also filter by symbol. Unless you know, you must make the MN an input and change it on each chart.
Magic number only allows an EA to identify its trades from all others. Using OrdersTotal/OrdersHistoryTotal (MT4) or PositionsTotal (MT5), directly and/or no Magic number filtering on your OrderSelect / Position select loop means your code is incompatible with every EA (including itself on other charts and manual trading.)
          Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 programming forum
          PositionClose is not working - MQL5 programming forum
          MagicNumber: "Magic" Identifier of the Order - MQL4 Articles

Reason: