SELECT_BY_POS: Is it the newest or the oldest order?
Changhua Lin:
Hi, is the ticketnumber the newest or the oldest ticket of the orders?
Position 0 is the newest opened trade.
Please read the help pages in metaeditor OR the link near top of every page on this website, "Documentation".
Changhua Lin: Hi, is the ticketnumber the newest or the oldest ticket of the orders? ... Sorry I'm not a programmer, I just want to know which order is newer selected by pos, 0 or 1?
My understanding is there's no guarantee the orders are returned in time order so you need to compare OrderOpenTime() of each order.
Changhua Lin:
Hi, is the ticketnumber the newest or the oldest ticket of the orders?
Hi, is the ticketnumber the newest or the oldest ticket of the orders?
You can't know for sure. As mentioned above, check the order opening time.
Changhua Lin: and how about
for(int i=ordersTotal()-1; i>=0; i--)
This way is better and preferable.
Hi, is the ticketnumber the newest or the oldest ticket of the orders?
and how about
Thank you.
PS: Sorry I'm not a programmer, I just want to know which order is newer selected by pos, 0 or 1?