You will need to loop down through the history pool from OrdersHistoryTotal()-1 to 0, checking the sign of OrderProfit() - and OrderCloseTime() if you need to.
If the account could possibly have manual orders etc, then you'll need to identify those placed by your EA using OrderSymbol(), OrderComment(), OrderMagicNumber() etc.
CB
If the account could possibly have manual orders etc, then you'll need to identify those placed by your EA using OrderSymbol(), OrderComment(), OrderMagicNumber() etc.
CB
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
How can I do that?
Using:
OrderSelect(0, SELECT_BY_POS, MODE_HISTORY)
doesn't seems to bring last close trade...
Thanks