-
Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
General rules and best pratices of the Forum. - General - MQL5 programming forum?
Next time post in the correct place. The moderators will likely move this thread there soon. -
int oht = OrdersHistoryTotal()-1; double partOHT = (OrdersHistoryTotal()*numOrders2); for(int i = oht ; i >= partOHT ; i--)
OHT-1 will never be greater or equal than OHT * n.
-
Do not assume history is ordered by date, it's not.
Could EA Really Live By Order_History Alone? (ubzen) - MQL4 programming forum 2012.04.21
Taking the last profit and storing it in a variable | MQL4 - MQL4 programming forum #3 2020.06.08
Hi,
I have a a couple of loops counting P/L trades and it works without issues in back-test but when I start the EA live, they fail to get the trades with matching magicnumber from Account History.
Note that it still gets the live OrdersHistoryTotal number when starting EA live but can no longer find the profit and loss trades. There are plenty of trades with matching Magicnumber so this should not be an issue.
Any help is appriciated. Thanks in advance
See code :