Today I am going to tell you how you can apply 100 systems at the same time and have them controlled without going crazy.
No, I don’t mean that you have to apply a gazillion systems to get profitable in trading. But if different ways of trading systems you need to keep track of them and evaluate or supervise them.
If you do not do this, you will have open operations and you will not know where the profits come from (or the collejas in the form of losses).
If you apply EAs (Expert Advisors, I’ll explain it better in this article ), you will see that it is quite simple through Magic Numbers. I’ll explain.
1. What are Magic Numbers?
A Magic Number or Magic Number is a unique number that is associated by the expert advisors to each order that is sent to the broker and thus be able to track all the open positions and differentiate them from the rest of the open orders at that time in the same account.
This magic number makes it possible for each system to know which open positions it should manage and which ones it should not.
In the case of MetaTrader4, trades opened by an EA can be assigned magic numbers ranging from 0 to 2147483647. However, the Magic Number of an EA must be different from zero since this is the default value of all the orders. This means that the manually opened orders have a magic number equal to zero, since no magic number is assigned. Now I am going to explain how to use them.
2. How to use Magic Numbers correctly to track various systems
Magic numbers are truly magical tools to identify trades when we trade two or more EAs on the same currency pair, but in different time frames. Suppose you are trading the GBP / USD pair with two different EAs, one trades 5 min candles and the other 1 hour candles. In my personal experience I can assure you that each EA will have to manage open trades differently for each time frame, for example: take profit or stop loss. This is where magic numbers work their magic.
EAs use a function called OrderSend (MQL language) to open or send a trade to our broker. This function has several parameters, but it is the OrderMagicNumber variable that assigns a unique number to each operation when it is opened.
Continuing with the previous example, we can assign a MagicNumber equal to 1 to the EA that will operate with 5 min candles and a MagicNumber equal to 2 to the EA that will operate with 1 hour candles. In this way, all trades opened by one EA will have a unique identifier number equal to 1 and trades opened by the other EA a unique number equal to 2.
Then when the EA wants to select or choose an order, it will use the OrderSelect function with the OrderMagicNumber variable previously assigned in OrderSend to manage the orders.
Now, you will surely wonder, where do I have to do all this? Expert advisors are files with an .ex4 or .ex5 extension that usually already have this magic number assigned that we can also assign when we install it. How?
To use an EA, you just have to add it to the asset’s chart and the time frame where it will be executed, set a magic number and that’s it.
I explain it to you in detail.
In the browser window of the MetaTrader platform we can see the EAs that we have installed on our platform.
Right clicking on them will open a pop-up menu where we must select the option “Attach to chart” that will take us to another window that will ask us to enter the input parameters that the trading system needs to start operating, including the Magic_Number.
We can also modify the code of our strategy by right clicking on it and selecting the “Edit” option, this will take us to the MetaEditor window. Of course, I do not recommend changing anything in the code if you are not a developer.
3. Systems monitoring platform
Once all the trading systems are installed, the easiest part comes. Monitoring.
You will be thinking what the hell to do once your EAs have been executed. Do I write them down on paper? Can I make a thousand excel tables? Nothing of that.
There are platforms to monitor your systems by connecting your account, filter by Magic Numbers and see for each one the number of operations, the profit or loss generated …
In this image I show you how you can do it in a simple way with FXBlue. You can also do it with Myfxbook or some extension for Metatrader.
Although using code may seem a bit complicated if you are just starting out, MetaTrader is an easy platform to use and you just need to practice.
With EAs you can test many strategies at the same time in the same account, 24 hours a day from Monday to Friday.
Although there are other ways to keep track of your systems, using Magic Numbers is the easiest and most comfortable way to do it.
Keep in mind that the main objective of using Magic Numbers is to simplify and control our operations. Please don’t forget to test any strategy before applying it to a live account.