I know that there is no way manually. But i hope MT has thought about this and gave us the ability to change through code. I mean if you can set it through code, won't it make sense to also change it through code?
No you cannot change the "Magic Number" after placement, neither manually nor programmatically! Modifying it defeats the purpose of its intended purpose. So it makes total sense that it can NOT be changed after the fact.
Why defeats the purpose!
Magic number can be created for many reasons, one of them is to control which positions get closed and which stay open.
So at certain times you would want to change the magic number between being able to close or not.
Magic number is not just for dealing with multiple symbols, thus you wouldn't want to change it. There are many reason that it can be used for.
Why defeats the purpose!
Magic number can be created for many reasons, one of them is to control which positions get closed and which stay open.
So at certain times you would want to change the magic number between being able to close or not.
Magic number is not just for dealing with multiple symbols, thus you wouldn't want to change it. There are many reason that it can be used for.
Read the documentation!
- "MAGIC: ID of an Expert Advisor that has placed the order (designed to ensure that each Expert Advisor places its own unique number)"
Read the documentation!
- "MAGIC: ID of an Expert Advisor that has placed the order (designed to ensure that each Expert Advisor places its own unique number)"
I am not arguing about the purpose you mentioning. I am saying that it would be more beneficial to be able to change it. WHat's the big deal!
What part of "defeats the purpose" do you not understand?
Give one reason where it would be "beneficial"?
Probably off topic, but since it is about fields of order(s) that can not be changed by user(s) ...
Maybe just one part of an order that are currently not allowed to be changed, would be beneficial to become changeable : the comment
Frankly I never understood why the broker is allowed to change the comment field of an order and users are not
Your argument considered, @Hesham Ahmed Kamal Barakat's needs probably are means to track. It is perfectly possible to use 1 unique magic with every order.
However the reason why it is not possible to change the comment is trade servers being subject to non-trade requests and i would agree it is not beneficial for anyone, except the one tracking some order.
Your argument considered, @Hesham Ahmed Kamal Barakat's needs probably are means to track. It is perfectly possible to use 1 unique magic with every order.
However the reason why it is not possible to change the comment is trade servers being subject to non-trade requests and i would agree it is not beneficial for anyone, except the one tracking some order.
I don't mean changing comment in a non-trading request : that would serve no purpose at all, except for stuff like DDOS or similar s... (ie: changing only the comment should be disallowed)
But changing the comment as a part of legitimate order processing (any legitimate order processing that currently exists) would make some things so much simpler. Just thinking out loud though ...
Agreed, it would allow for the order state for the TS logic to reside on the trade server instead of local, this to do local, i also agree, is troublesome to realize, but it is possible.
It will make life easier and logic simpler.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I have already placed positions with certain magic numbers, along the way i want to be able to change the magic numbers as i go.
Is there a way to do it through coding?
I know that there is no way manually. But i hope MT has thought about this and gave us the ability to change through code.
I mean if you can set it through code, won't it make sense to also change it through code?