- MetaEditor - Professional editor of trading applications
- Download MetaTrader 5 build 1730 with new trader features
- MQL5 Wizard: Development of trading robots for MetaTrader 5
This is strange question.
Magic number is not mandatory in the order, but if there is a magic in the order, you can read it from MQL.
Magic number can be written to the order only at the moment when the order is opened. It can't be changed after that.
Attached is a script that will list order tickets and corresponding magic numbers. List will be visible at the Experts tab.
Copy attached file to the scripts folder.
This is strange question.
Magic number is not mandatory in the order, but if there is a magic in the order, you can read it from MQL.
Magic number can be written to the order only at the moment when the order is opened. It can't be changed after that.
Attached is a script that will list order tickets and corresponding magic numbers. List will be visible at the Experts tab.
Copy attached file to the scripts folder.
Magic number is just some random value you can attach to you order. It is usually used as means of order identification. For example - you can read that number from the order and then decide if that order should be included in some decision.
You must ask your developer what exactly he means with "magic number isn't being recognized". If order has magic number, you can read it. If order does not have magic number - you can't read it.
Without code it is impossible to tell what is happening.
Thank you so much I'll have a look at the script. Do you think the magic number issue might be causing multiple EA's opening at the same time even though they have different logic? In those EA's I have different magic numbers for each
Were the EA's all created by the same coder? If so, he may have accidentally hard coded the same magic into every EA rather than using the input variable. As drazen said above, without seeing the code the best we can do is guess ;)
Cheers
G'day Dave
Were the EA's all created by the same coder? If so, he may have accidentally hard coded the same magic into every EA rather than using the input variable. As drazen said above, without seeing the code the best we can do is guess ;)
Cheers
After a quick look, it seems that there shouldn't be magic number problems in this EA.
Only thing I discovered is that EA does not check magic number when it is closing order.
So, if you have same type orders on the same currency pair, this EA will close all of them, no matter which magic number they have.
This means that EA can close orders that it did not open.
Detailed test requires time and you should provide detailed description of problems - what is happening and what you expected to happen.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use