Anyone knows a way to change the magic number of an already placed position?

Hesham Ahmed Kamal Barakat  

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?

Dominik Egert  
I am not absolutely sure, but I do not think so.

Try using comment on positions to do tracking. They in fact update.

Greetings
Fernando Carreiro  
Hesham Ahmed Kamal Barakat: 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?

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.
Hesham Ahmed Kamal Barakat  
Fernando Carreiro:
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.

Fernando Carreiro  
Hesham Ahmed Kamal Barakat:

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)"
The Magic number is primarily used for identifying which EA (or sub-process of the EA) placed the Order, so as to further manage it during its life-time and for follow-up in historic reporting.
Hesham Ahmed Kamal Barakat  
Fernando Carreiro:

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)"
The Magic number is primarily used for identifying which EA (or sub-process of the EA) placed the Order, so as to further manage it during its life-time and for follow-up in historic reporting.

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!

Enrique Dangeroux  

What part of "defeats the purpose" do you not understand?

Give one reason where it would be "beneficial"?

Mladen Rakic  

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

Mladen Rakic  
Enrique Dangeroux:

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 ...

Reason: