Discussion of article "Library for easy and quick development of MetaTrader programs (part V): Classes and collection of trading events, sending events to the program" - page 2 12 New comment Keith Watford 2020.08.30 02:03 #11 Alvaro Arioni: Please edit your post and use the code button (Alt+S) when pasting code Alvaro Arioni 2020.08.30 16:36 #12 Artyom Trishkin: There may be more than one lost order OK, but the function is still returning just one of the lost orders, that which is closest to zero. In this case, wouldn’t be the same iterating from 0 to start-1 with a break? ulong CHistoryCollection::OrderSearch(const int start,ENUM_ORDER_TYPE &order_type) { ulong order_ticket=0; for(int i=0; i < start ;i++) { ulong ticket=::HistoryOrderGetTicket(i); if(ticket==0) continue; ENUM_ORDER_TYPE type=(ENUM_ORDER_TYPE)::HistoryOrderGetInteger(ticket,ORDER_TYPE); if(this.IsPresentOrderInList(ticket,type)) continue; order_ticket=ticket; order_type=type; break; } return order_ticket; } I know that it is just a detail, but I thought this could be a little improvement, especially in case of a too big history of orders. Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions www.mql5.com //| Expert initialization function | //| Expert deinitialization function | //| Expert tick function | //| test1 |... Analogue to iBarShift Spread trading in Meta Universal MA Cross EA Artyom Trishkin 2020.08.30 21:06 #13 Alvaro Arioni : OK, but the function is still returning just one of the lost orders, that which is closest to zero. In this case, wouldn’t be the same iterating from 0 to start-1 with a break? I know that it is just a detail, but I thought this could be a little improvement, especially in case of a too big history of orders. Ok, thanks, I'll check and test everything. It may well be that "break" will come in handy. 12 New comment
Please edit your post and
use the code button (Alt+S) when pasting code
There may be more than one lost order
OK, but the function is still returning just one of the lost orders, that which is closest to zero.
In this case, wouldn’t be the same iterating from 0 to start-1 with a break?
I know that it is just a detail, but I thought this could be a little improvement, especially in case of a too big history of orders.
OK, but the function is still returning just one of the lost orders, that which is closest to zero.
In this case, wouldn’t be the same iterating from 0 to start-1 with a break?
I know that it is just a detail, but I thought this could be a little improvement, especially in case of a too big history of orders.
Ok, thanks, I'll check and test everything.
It may well be that "break" will come in handy.