For loop and jumping orders

 

Hello guys,


I use the standard

   for(int i = OrdersTotal() - 1; i >= 0; i--)

     {

      if(OrderSelect(i, SELECT_BY_POS))

        {

         if(Symbol() == OrderSymbol() && magicNumber == OrderMagicNumber())

.........


to pass every order from the last opened to the first opened but if I want to do the opposite, for example to see what was the first lot opened for a specific pair or to add the profit of the first 3 orders, I write:

   for (int i = 0; i <= OrdersTotal() - 1; i++)

     {

        if (OrderSelect(i, SELECT_BY_POS))

        {

            if (Symbol() == OrderSymbol() && magicNumber == OrderMagicNumber())

            {

.......


But I think that some orders are not calculated or it jumps some of them.


Why is that happening?


 
planetman:

Hello guys,


I use the standard

 

Why is that happening?


Edit your post. Use the code button to post code.

Do not repost, edit your existing post.
Reason: