What does the MagicNumber and Identifier mean in MT4 EA's?

 

Does changing the values on MagicNumber and Identifier give you different results?


 
Derek Casanares:

Does changing the values on MagicNumber and Identifier give you different results?


You are talking about a specific EA and not MT4 EAs in general, so you better check with the author/seller.

However changing the magic number, does not affect testing results.

 
Derek Casanares: Does changing the values on MagicNumber and Identifier give you different results?

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
 

magic number is a number that  allows you to identify if a order was created by your expert or not.
for example think you have a expert with opens and closes orders based on 2 ma crossing. and you also some other experts working on the same chart, at closing condition how you going to know which orders are for your ma expert so you can avoid closing other experts trades ? that is were magic number comes in.
about identifier i have no knowledge, it seems to be created with coder and may be used for many things for example creating object names so you can delete all objects containing that identifier in name at the deinit.

i hope my answers be helpfull

 

Hello,

To tell you very simply, the magic numbers identify specific charts.  You need to use different/unique magic numbers in order to avoid any conflicts between multiple EAs.


Cheers.

Reason: