question about using index in orderselect function (when I write "0" is giving me data of the first operation, not the last one)

 
I'm writing "0" in the index of orderselect function  to refer to the last closed operation, but when I do this, it is giving me the data of the first closed operation (the first in the history accounts).


What is happening here, and what I need to do, for make reference to the last operation closed?


Thanks in advance

 
OrdersTotal() - 1 // for open trades
OrdersHistoryTotal() - 1 // for closed trades (history)


0 is the first one, not the last

 
Thank you gjol.
Reason: