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
Provided all the links with details. Everything works correctly.
I understand the question, but I want to clarify: is it possible to just get a list similar to position history in MT5, without going into details?
Forum on trading, automated trading systems and testing trading strategies
Libraries: MT4Orders
fxsaber, 2025.12.15 11:48 AM
https://www.mql5.com/ru/blogs/post/754817
volume is still not enough for 0.01 lot.
Provide evidence of the error. I recommend to open a demo account on MT4 and try to make the same trading operations there.
is it possible to just get a list similar to the position history in MT5?
Result.
Through snapshots.
This seems wrong; the direction is incorrect and the order number doesn't seem to match either.
Forum on trading, automated trading systems and testing trading strategies
Libraries: MT4Orders
hini, 2025.12.17 02:14 pm.
That seems incorrect; the direction is incorrect, and the order number doesn't seem to match either.
In MT5, there are only two entities in the trade history: trades and orders. There are no positions in the trade history and for many years MT5 did not display closed positions.
MQ created this mode of displaying history by generating position history from trade/order history. That's generation. And unfortunately, in some situations it is wrong. In particular, in the above case.
Let's consider the chronology of trading operations in this situation.
In total, exactly three trades were made. And it fully corresponds to what the script shows in the quote above.
In the trade history, OrderTicket is a ticket of the transaction closing the position. Each position has its own OrderTicket. MT4Orders generates the history of positions unambiguously.
The same POSITION_ID (OrderTicketID) value can be used for different positions that did not even overlap in the time of their existence. MT5 generates position history freely.
Take a look at these lines of MT5 position history generation (red is not mine).
There's a lot there that raises questions. In particular, was there a trade turnover (full circle) of 0.05 lots?
Many different trading situations are dealt with in detail on the blog.
I repeated the experiment and it seems that the historical positions generated by MT5 are correct:
Here I manually opened positions: buy-0.04, sell-0.01, buy-0.04, and then closed all with one button.
And the historical positions generated via CloseBy are different from the one I created manually.
Here are the MT5: historical positions