Select First and Last Order only

 

hey there

i am new to MQL

i am trying to select only the First and Last order through OrderSelect function but its not working.

i have tried it through OrderTicket function but its still not working.

any help will be highly appreciated

Reason: