MQL4: Last closed order - I looking for the IDEA
Does anybody know how to find and select (in SIMPLE WAY) last closed order in OrdersHistoryTotal()? Any function how to do it can I please?
- How to ModifyOrder() pending (buylimit & selllimit) using MQL5 syntax code?
- MQL4 - OrdersHistoryTotal() - one question
- How to check the OrderProfit() from 3 last closed orders for the current Symbol() in OrdersHistoryTotal() list ?
Here Ya Go.
//################################################################# //################################################################# int start(){ //################################################################# //################################################################# for(int a=OrdersHistoryTotal()-1;a>=0;a--){ if(OrderSelect(a,SELECT_BY_POS,MODE_HISTORY)==true){ int Ticket=OrderTicket();Alert(Ticket);break; } } //################################################################# //################################################################# return(0);} //################################################################# //#################################################################
In function Mode:
//################################################################# //################################################################# int Get_LastClose(){ //################################################################# //################################################################# for(int a=OrdersHistoryTotal()-1;a>=0;a--){ if(OrderSelect(a,SELECT_BY_POS,MODE_HISTORY)==true){ int Ticket=OrderTicket();break; } } //################################################################# //################################################################# return(Ticket);} //################################################################# //#################################################################
ubzen:
Here Ya Go.
In function Mode:
Thanks a LOT! You have one beer from me - COLD BRONEK for YOU!