Popular Posts

Editor'S Choice - 2020

What is Magic Number in advisor settings

Hello friends traders! Very often in the description of the settings of Forex advisors you can find such a thing as Magic number (or just magic on the slang of the forums). What is it? How to set up magic number? What does it affect? About all this - in our lesson.

Ordinary users very often have a lot of questions about this parameter. By combining these issues into one short article, I decided to help you clarify some tricky points.

Below you can find the most popular questions that may arise, both for beginners and experienced traders.

What Magic Number?

Magic Number is a numeric identifier that is used by the adviser so that it does not confuse its and other orders. It is needed so that the adviser does not touch the orders of other experts, as well as positions opened manually.

The EA assigns a specific code to its orders. This allows him to distinguish all the positions that are currently in the terminal, and work only with those orders that he opened himself.

With the help of Magic Number, the EA understands which orders it is and which orders are foreign.

The number can be absolutely anything except zero.

Do I need to change Magic Number when installing the same advisor on different pairs?

Suppose you have an adviser that you would like to install on the EURUSD and GBPUSD currency pairs. To do this, you open two different chart windows and attach an adviser to each of them. Then a logical question arises:

Is it necessary to change the parameter so that these experts are not confused?

Change Magic Number, if the currency pairs are different - no need!

If we put the same Expert Advisor on different pairs, then this parameter is not required to be changed.

And if I want to install the same advisor on 2 charts of the same currency pair, but with different timeframes?

Imagine that you put the adviser on the M15 timeframe. And exactly the same adviser, but on the H4 timeframe.

In this case, the Magic Number should be different in the settings of this advisor.

Otherwise, it will begin to confuse orders and thus open and close them on different timeframes.

Therefore, if for some reason you want to install the same adviser on two charts of the same currency pair, but with different timeframes, then in this case you will need to change the advisor settings. So that the numerical values ​​of the parameter do not match.

What happens if 2 different advisors have the same Magic Number?

If two advisers suddenly have the same value, then they will begin to confuse each other's orders.

Let’s say that we have the “X” and “Y” advisors with the same magic number numeric parameters. Advisor X opens an order, while Advisor U thinks it is his order and begins to manage it according to his strategy. And if the strategy of the adviser “U” says that you need to close the order, then it will close the order of the adviser “X”.

And all because they have the same Magic Number parameters.

Therefore, in order for one EA not to confuse its orders with the positions of another, it is necessary that this parameter does not coincide with them. They must be different.

There is no robot in the settings Magic NumberHe will not confuse warrants?

Sometimes it happens that there is no Magic Number parameter in the expert settings. This does not mean that he is not in the adviser. It is in the code. It’s just that the authors of the adviser did not want to provide the ability to edit it.

You can use such an adviser, because he will not confuse his orders with strangers. Its Magic Number is hidden in the code and pre-set by the developers of this adviser.

Which one then Magic Number do manual deals?

In manual transactions, the Magic Number is zero. That is why this parameter can be any number other than zero. During the opening of manual transactions, you do not assign any identifier. There is no such possibility in the terminal, but in fact it is not needed.

If you want to use some kind of auxiliary adviser that will modify orders that you manually open, then you will need to set zero in its magic number parameter.

That’s all for me.

I hope I was able to help you deal with this parameter, which will be useful in your Forex trading.

Watch the video: Magic number Forex - The Expert Advisors (January 2020).

Leave Your Comment