help the simple code output is error

 
    for(int sd=0;sd<500;sd++)
      {
         if(OrderSelect(sd,SELECT_BY_POS,MODE_TRADES)==true)
            {
              Alert(sd);
           }
      }


I run the script,THE ea OUTPUT 1,2,3,4,5,6,,why ,why it not output 0-500;
    
i have seven tickets
 
There is no ticket number 0 so if ( OrderSelect(...) ) was false, if the ticket numbers do not go up to 500 same problem.
Reason: