my EA is only taking 1 trade at a time

 

hello my EA is only taking 1 trade at a time maybe there is something wrong in the order counter section code

do I need to change something its a simple code thought to get help here

//+------------------------------------------------------------------+
//| Order Counter                                                    |
//+------------------------------------------------------------------+

int order_counter(int magic)
{
   int num=0;
   
   for(int i=OrdersTotal()-1;i>=0;i--)
      {
         if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==True)
            {
               if(Order
               
               
               Number()==magic )
                  {
                    num++; 
                  } 

            }
      }
      return(num);
}
 

Post code that compiles.

What is this?

               if(Order
               
               
               Number()==magic )
                  {
                    num++; 
                  } 

How do you expect an answer? There is nothing there about opening orders.

Topics concerning MT4 and MQL4 have their own section.

In future please post in the correct section.

I have moved your topic to the MQL4 and Metatrader 4 section.

 
Keith Watford:

Post code that compiles.

What is this?

How do you expect an answer? There is nothing there about opening orders.

Topics concerning MT4 and MQL4 have their own section.

In future please post in the correct section.

I have moved your topic to the MQL4 and Metatrader 4 section.

 this is what the freelancer here has coded for me :):)

 
Ayman Tawil:

sadly this is what the freelancer here has coded for me :):)

If that snippet is part of the EA code, then the EA will not work at all as it will not compile. So it is not possible that the EA will take any trades at all.

Maybe you have copied it incorrectly?