ORDER_POSITION_ID - page 4

 
papaklass:

Programmers have a rule - discuss code!

If you have a problem with your code, you MUST post the code where you encountered the problem. In such a situation, you are sure to find someone willing to help you. But you are inventing something new: you are trying to discuss a problem you encountered "on your fingers" without the code.

I won't be surprised if in the near future, your questions will remain unanswered not only in the Service Desk, but also on the forum.

Try to draw the right conclusions and don't be stupid. :)

I have no problem with the code working!

I originally prashivala:

WHO USES THE FOLLOWING CODE:

long pos_id = long( OrderGetInteger( ORDER_POSITION_ID ) );

When will you learn to read the question?

 
Mikalas:

I have no problem with the code working!

I originally prasheed:

WHO USES THE FOLLOWING CODE:

When will you learn to read the question?

You also asked:

With me, when an order is partially executed, pos_id always = 0

Why?

 
Contender:

You also asked:

Yes, I did, so I didn't ask it later to the person who USES that code.

 
Mikalas:

With me, when an order is partially executed pos_id always = 0

Why?

From the MQ help:

ORDER_POSITION_ID

The position identifier which is put on the order when it is executed. Each executed order generates a trade, which opens a new position or modifies an existing one. The identifier of this position is set to the executed order at that moment.

This may be due to the fact that it (the order) has not yet been fully executed, and it is possible that this order will participate in the formation of another position.
 
Yurich:
Perhaps, this is due to the fact that it (the order) has not yet been fully executed, and it is possible that this order will participate in the formation of another position.

It's a pleasure to talk to you, Yurich, good day!

But the thing is,I've been doing my experiments withORDER_POSITION_ID

on demo-server (no one is preventing me from tracing the program).

And the function call

long GetOrderPosId( const ulong ticket )

is called in a "satisfied" situation.

And I got worried about it, with your tip, about magic, once again, thank you very much!

I understand the phrases you've highlighted, but then why did you write MQ?

Eachexecuted order generatesa trade, which opens a newposition or modifies an existing one

That's what confuses me.

The deal isORDER_POSITION_ID, maybe I'm wrong, but there is no response from mz servicedesk.

If I simply cancel the order after it has been partially executed, it will not haveORDER_POSITION_ID?

The identifier of this position isset to the executed order at that moment.

 
Mikalas:

And the function call

takes place in a "settled" situation.

You are asking for the id of the placed order, not the executed order. The executed order will be in the history.

 
Mikalas:


If I simply cancel the order after it has been partially executed, it will not havean ORDER_POSITION_ID?

In theory, the history should show the executed part of the order. Or it is not there?

I asked you a question that you have not noticed:https://www.mql5.com/ru/forum/35432/page2#comment_1042916

 
Yurich:

You are asking for the id of the placed order, not the executed order. The executed order will be in the history.

I.e.ORDER_POSITION_ID for the history data?

But in Help:

Properties of Orders

Orders for performing trade operations are processed by orders. Each order has many properties to read, and the information about them can be obtained using the OrderGet...() and HistoryOrderGet...()functions .

 
Contender:

You are observing this partially executed warrant. Where is it? In the trade list or in the executed ones?

The order is active.
 
Mikalas:
I.e.ORDER_POSITION_ID for historical data?
yes