Magic Number in Metatrader

In real life, a trader may encounter different situations, all of which have the easiest solution using the Magic Number. For example, the trader combines in its own operative hand account with one or more Expert Advisors. The EA should manage its own operations without interfering with the operations that the trader carried out manually or with another EA operation. A simple solution can be assigned a unique number and different to all orders to open the same Expert Advisor. The Magic Number must be non-zero, then zero is the default for all orders, which is the same as saying that if the Magic Number is zero, an order has no Magic Number. Thus, the operations will not open manually MagicNumber and open operations group for the same EA that share the same ID number so that each EA can know what the orders should be handled and what not, this identifier is the MagicNumber.

The last situation where the Magic Number is saved in an easy and simple way in which a single EA is operating on the same account, different timeframes in the same or different currency pair. In this situation you can associate a different MagicNumber and  Expert Advisor. For example, put a Magic Number to EA in the timeframe 15 minutes of the EUR / USD and another Magic Number differently to the same EA operating in the EUR / USD but timeframe 30 minutes. Even with this implementation of the Magic Number you can have the same EA working on two graphs different from the same pair of currencies and same timeframe but with different settings on each graph. For example, we could have an EA based on moving averages trading in EUR / USD M15 with exponential moving averages, and the same EA running on another chart of EUR / USD M15 with simple moving averages.