RoboForex – Professional services on Forex market

What is MagicNumber?


Recommended
VPS-servers
More →
How to get a license

for free!

More →
Crypto exchange
Crypto Wallets
More →

VR Stealth Pro - an adviser invisible to the broker
VR Stealth Pro - an adviser invisible to the broker

Icon of the program version Version: 16.120

Icon program update date Updated: 13.12.2016

Icon date the program was added Added: 10.09.2014

License: Free

One-time purchase: 0$

Rent: from 0$

The expert Advisor's interface is intuitive and easy. The EA hides the take Profit, Stop Loss, Breakeven, and Trailing Stop trading levels.

VR Locker - successful lock trading
VR Locker - successful lock trading

Icon of the program version Version: 22.040

Icon program update date Updated: 11.04.2022

Icon date the program was added Added: 30.08.2017

License: Paid-Free

One-time purchase: 122$85$

Rent: from 30$from 21$

The program trades according to a unique logic, the task of which is not just to fix the profit, but also to use the accumulated profit as a safety cushion, which significantly reduces the drawdown on the balance.

VR Close All - Close all orders if ...
VR Close All - Close all orders if ...

Icon of the program version Version: 17.100

Icon program update date Updated: 12.08.2015

Icon date the program was added Added: 04.08.2015

License: Free

One-time purchase: 0$

Rent: from 0$

Designed for closing/deleting all orders in the terminal. It helps to fix profit or loss on the entire trading account.

MagicNumber

What is MagicNumber in a trading robot?

MagicNumber is the same as Magic or Magic number - this is a unique number written by the trader in the settings of the trading robot. The number can be either negative or positive. In most cases, MagicNumber is already specified by the programmer in the default settings. You can view the work of the trading robot with MagicNumber using link.

Russian video description "What is MagicNumber?"

What is MagicNumber used for?

MagicNumber is used to recognize orders, transactions, positions on the principle of "yours - someone else". Each trading robot marks its transactions, positions, orders with one unique number - MagicNumber. Further, in the process of work, in order for the trading robot to find its trading orders, transactions, positions, it is enough to search by the MagicNumber value. This is how each trading robot works only with its own trading orders and excludes from its attention the trading orders of another trading robot.

When should you change MagicNumber?

MagicNumber should be changed in the settings of the trading robot if a trading robot with exactly the same MagicNumber has previously or is currently working on the trading account. Regardless of the financial instrument on which trading applications are located, the best and most reliable solution will be a unique MagicNumber for each trading application.
Most trading applications calculate the trader’s trading statistics and trading results by selecting orders, transactions, positions according to the number specified in the settings MagicNumber. To start keeping statistics from the very beginning, you can change the MagicNumber to another unique number.

MagicNumber

Which MagicNumber should I set?

The best solution to bet MagicNumber will be your favorite numbers that you will never forget. The number can be anything, the main thing is that it is greater than 0.

What types of MagicNumber are there?

  • 0 - this number marks all orders, transactions and positions opened and created manually by the trader through the standard tools of the MetaTrader terminal. It is important to emphasize that only orders, transactions, and positions created by the standard tools of the MetaTrader terminal are marked with zero. When using trading robots, trading panels, and other trading applications, the creation of a trading order with MagicNumber equal to 0 is not guaranteed.
  • -1 - this number is used in trading robots and trading panels for the MetaTrader terminal in cases where you need to gain access and control to absolutely all orders, transactions, positions, regardless of the method or trading application they were created. It should be noted that not all trading robots and trading panels are able to take into account the MagicNumber value equal to -1. The best solution would be to clarify this information with the developer of the trading robot or trading panel.
  • More than 0 - numbers such as 1, 23, 56, etc. mark all orders, transactions, positions in the normal standard mode of operation of a trading robot or trading panel.

Are there applications without MagicNumber?

In some trading applications or trading robots, the logic and operation of the trading strategy is structured in such a way that it requires the use of several MagicNumbers. Typically, programmers in such cases hide the MagicNumber setting from the settings window of a trading robot or application.

Errors when working with MagicNumber

The most common and common mistake made by traders is changing the MagicNumber during the operation of a trading robot or trading panel. It turns out that when the MagicNumber is changed, the trading application “forgets” and excludes from its control transactions, orders, positions previously opened with a different MagicNumber.
The next mistake is setting up trading applications with the same MagicNumber, as a result of which several trading robots and trading panels take control and control not only of their own trading orders, but also of the trading orders of other trading applications. As a result, a conflict of trading applications occurs on the trading account, which can manifest itself in different ways:
- Frequent opening and closing of positions;
- Frequent changes in StopLoss and TakeProfit;
- Frequent deletions of trading levels;
/> - Removing or moving graphic elements of the interface of trading applications;

Do I need to include the MagicNumber setting in the optimization of a trading robot?

There is no need to include the MagicNumber setting in optimization. This setting does not affect the trading results of the trading robot in any way. The MagicNumber setting is not involved in any way in the operating logic of an automatic trading strategy or trading robot and has no impact on the final result of the trading application. This is why competent programmers in most cases prohibit optimizing MagicNumber.

Code and filter for MagicNumber in the trading application code

In most cases, MagicNumber is used only as a filter when selecting trading orders, deals and positions for further work with them.
Code example:
if(pos.Magic() == MagicNumber || MagicNumber = = -1) // If the position is opened by this robot or the trader has set up work with absolutely all positions.

MagicNumber what's the result?

MagicNumber is an important setting for a trading application that helps trading robots and applications determine what or who created trading orders on the trader’s account.

Comments

To write a comment, log in Enter
Registration

Login

Password recovery Registration
Login

Password recovery Registration
Password request

If you forgot your password, enter your e-mail. The control line for changing the password will be sent to you by e-mail.

A link has been sent to your email address to confirm the E-mail address. To complete the registration, follow this link.

If you have not received an email to your email, check the Spam folder. If there is no letter there either, then contact us.

Registration completed successfully!

You have successfully logged in to the site!

We use both our own cookies and third-party cookies for the purpose of analysis, as well as to display ads based on your preferences, in accordance with your browsing habits and your profile. For more information, please see our Privacy Policy.
Even more in the Telegram community Send us a message