New to Coding need a little Help - page 4

 

There are limits and you made a bad start by using the term little help.

It's already 4 pages long and were just getting started.

Try to solve it because then you will learn the most from it.

//+------------------------------------------------------------------+
int TotalNoOfOrders()
  {
   int i=0;
     {
      int total=OrdersTotal();
        {
         for(int pos=total;pos>0;pos--)
           {
            if(OrderSelect(pos,SELECT_BY_POS,MODE_TRADES))
              {
               if(OrderMagicNumber()==MagicNumber))
                 {
                  if(OrderSymbol()==Symbol())
                    {
                     i++;
                    }
                 }
              }
           }
        }
     }
   return(i);
  }
//+------------------------------------------------------------------+
 
Marco vd Heijden:

There are limits and you made a bad start by using the term little help.

It's already 4 pages long and were just getting started.

Try to solve it because then you will learn the most from it.


Your examples are missing one order in the pool. When counting down you need to include index zero in the loop. 

//for(int pos=total;pos>0;pos--)
for(int pos=total;pos>=0;pos--)
 
nicholishen:

Your examples are missing one order in the pool. When counting down you need to include index zero in the loop. 

Okay and now it is your turn to help Angel Dickinson

 
Marco vd Heijden:

Okay and now it is your turn to help Angel Dickinson


hehe..