![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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:
When will you learn to read the question?
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?
You also asked:
Yes, I did, so I didn't ask it later to the person who USES that code.
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.
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
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.
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.
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
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 .
You are observing this partially executed warrant. Where is it? In the trade list or in the executed ones?
I.e.ORDER_POSITION_ID for historical data?