Hey Guys, i've built an EA and i want to select the very last closed trade. I've tried everything that is in my skillbox. I've researched the forum and read every function that would help me in the documentary, i can't solve this.
I need the ticket of the very last closed Trade, so the EA can differ between loss/win trade (not a problem if get the ticket) and adjust the lot-size for the next trade.
Thank you! :)
Learn to use the search and then you won't have to wait for someone to reply to your post . . .
You can do it in lot of ways.
1. You can compare the tickets and get the higher one
2. You can store in a variable the last lot size
You can do it in lot of ways.
1. You can compare the tickets and get the higher one
2. You can store in a variable the last lot size
the last closed trade has not always the highest ticketnumber ....
check OrderCloseTime
Try this:
OrderSelect(OrdersHistoryTotal()-1,SELECT_BY_POS,MODE_HISTORY)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hey Guys, i've built an EA and i want to select the very last closed trade. I've tried everything that is in my skillbox. I've researched the forum and read every function that would help me in the documentary, i can't solve this.
I need the ticket of the very last closed Trade, so the EA can differ between loss/win trade (not a problem if get the ticket) and adjust the lot-size for the next trade.
Thank you! :)