I have an mql4 function that retrieves the last historical order and then the profit of that last order.... I can't figure out how to do that in mql5.
In mql5, I can retrieve historical data on Orders and Deals. Orders are useless -- to the extent I can determine -- and it appears that any one order can generate multiple deals. I can't retrieve historical positions, there is no api call that I can determine. So, do I retrieve the most recent historical deal, pull the position id from it, gather all other historical deals, then sum all of their profits? If so, please shoot me in the head b/c that's ridiculous