Questions from Beginners MQL5 MT5 MetaTrader 5 - page 897

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
You can.
How?
How?
The little bugger's already told me everything.
The position identifier will not change. Use it to search for transactions.
Thank you. After clearing, the function does not return the average price of the trades as intended, but the price of the reopened position. Where is the error, please tell me.
Thank you. After clearing, the function does not return the average price of the trades as intended, but the price of the reopened position. Where is the error, please tell me.
If you are working with a position, work with the position. If you are working on a trade, work on the trade. The deal is the price of the deal, not the price of the position.
If you are working with a position, work with a position. If you are working on a trade, work on the trade. The deal shows the price of the trade, not the price of the position.
Didn't I select the trades involved in the opening of the position?
Didn't I select the trades involved in the opening of the position?
The algorithm is simple: you select a position, by position ID, all its trades. You select for work only those deals that form the volume of the position, i.e. you exclude clearing deals.
After choosing a position, you receive its deals, and then you request a price for the position! And you need the price of each specific transaction.
And you need the price of each specific transaction.
Sorry, I don't understand how to select a trade instead of a position, show me)
Sorry, I don't understand how to select a trade instead of a position, show me)
Okay, that's what I do.
Then I compare the transaction id with the position ticker, and I think I've selected the transaction,
but it returns the price of the position. Why?