David _Detnator_ :
You must independently collect the "HISTORIC POSITION" from the "historical trades". I once wrote an example: Reconstruction of positions
Reconstruction of positions
- www.mql5.com
An example of working with the trading history on Hedge accounts — reconstruction of positions.
Vladimir Karputov #:
You must independently collect the "HISTORIC POSITION" from the "historical trades". I once wrote an example: Reconstruction of positions
Not sure why I didn't reply to this earlier. Thought I did. My apologies.
Needless to say, thanks for the answer, and for the code. That's pretty neat!
Seems kind of odd that we have to do this ourselves...? I'm confused as to why it isn't built in alongside all the others. But still, at least there's a solution one way or another.
Thanks again!
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
Hello all.
Short version:
I've read everything I can find on this. Particularly the MQL5 Reference > Trade Functions, and this awesome article (ORDERS, POSITIONS AND DEALS IN METATRADER 5).
We have Functions for active orders, active positions, history orders, and history deals.
Why don't we have any functions for history positions?
Thanks!
.
.
.
.
.
A little more detail (ignore this if you want, mostly just for interest and to be thorough):
So every combination of those is these six:
Except Active Deals doesn't make sense because a orders and positions have a start and end, a life over an interval of time, but a deal is a single event: a moment in time. No start and end, so never "active".
So we should have five: Active Orders and Positions, and History Orders, Deals, and Positions.
And in MQL5 we have comprehensive functions for four of those (Active Orders and Positions, History Orders and Deals).
Why no functions for History Positions?