# net position and magic numbers

439

hi all,

I know magic numbers can be used to distinguish one ea's trades from another.

I wish to use different magic numbers within one ea. My question is knowing that mql5 treats your position in any market as a net position, meaning you cannot hedge, can i still a smaller number of individual buy orders with their own unique magic numbers as this sum of the order?

Or does having my position treated as a net position mean that all together this can just have one magic number?

I am hoping the answer is if i have 4 different longs on each with a volume of 1.0, all entered at different prices, even though mql5 and mt5 see this as a position of volume 4.0 at the average of the entries, can i access each of the indiviudal 1.0 order via a unique magic number?

Thank you for your help and time.

mrkie mark

Moderator
42417

markie1706:

hi all,

I know magic numbers can be used to distinguish one ea's trades from another.

I wish to use different magic numbers within one ea. My question is knowing that mql5 treats your position in any market as a net position, meaning you cannot hedge, can i still a smaller number of individual buy orders with their own unique magic numbers as this sum of the order?

Or does having my position treated as a net position mean that all together this can just have one magic number?

I am hoping the answer is if i have 4 different longs on each with a volume of 1.0, all entered at different prices, even though mql5 and mt5 see this as a position of volume 4.0 at the average of the entries, can i access each of the indiviudal 1.0 order via a unique magic number?

Thank you for your help and time.

mrkie mark

Hi markie1706, no you can't use different magic numbers in one position.
922

markie1706:

hi all,

I know magic numbers can be used to distinguish one ea's trades from another.

I wish to use different magic numbers within one ea. My question is knowing that mql5 treats your position in any market as a net position, meaning you cannot hedge, can i still a smaller number of individual buy orders with their own unique magic numbers as this sum of the order?

Or does having my position treated as a net position mean that all together this can just have one magic number?

I am hoping the answer is if i have 4 different longs on each with a volume of 1.0, all entered at different prices, even though mql5 and mt5 see this as a position of volume 4.0 at the average of the entries, can i access each of the indiviudal 1.0 order via a unique magic number?

Thank you for your help and time.

mrkie mark

I think it can be manipulated through history order. Position ID# actually is initial order ID#. The next orders with same symbol have their own order ID# but same Position ID# (which is first order ID#).
Moderator
32814

markie1706:

hi all,

I know magic numbers can be used to distinguish one ea's trades from another.

I wish to use different magic numbers within one ea. My question is knowing that mql5 treats your position in any market as a net position, meaning you cannot hedge, can i still a smaller number of individual buy orders with their own unique magic numbers as this sum of the order?

Or does having my position treated as a net position mean that all together this can just have one magic number?

I am hoping the answer is if i have 4 different longs on each with a volume of 1.0, all entered at different prices, even though mql5 and mt5 see this as a position of volume 4.0 at the average of the entries, can i access each of the indiviudal 1.0 order via a unique magic number?

Thank you for your help and time.

mrkie mark

Yes you can. You have to work with deals, not with position.