buy and sell every 10 points - page 3

 
RaptorUK:

And if the OrderSend fails don't you want to know why ? or would you rather waste time scratching you head and asking for help here ?

hahahahahahahahaha i will put getlasterror and i want to thank you :) and i will show you my strategie later :) :)
 
georgioooo:

hahahahahahahahaha i will put getlasterror and i want to thank you :) and i will show you my strategie later :) :)


I already put it in . . you took it out . . .

You are welcome, just keep learning ;-)

 
RaptorUK:


I already put it in . . you took it out . . .

if(OrdersTotal() > 1) //searching for last opening order
   {
   int OrderPosition = 0;

   while(OrderPosition < OrdersTotal())
      {
      if( OrderSelect(OrderPosition, SELECT_BY_POS, MODE_TRADES) && OrderMagicNumber() == MagicNo && OrderSymbol() == Symbol() && OrderType() == OP_SELL )
       
      lastorder=1;
      OrderPosition++;
      
      }
   }

hello Raptrok how are you? hope that i do not bother you!! but i have a question. this cycle at the top give the last order SELL .

but if i want to create a cycle to search the last order between only the sell opening order so i'm trying to that:

 
georgioooo:

hello Raptrok how are you? hope that i do not bother you!! but i have a question. this cycle at the top give the last order SELL .

but if i want to create a cycle to search the last order between only the sell opening order so i'm trying to that:


if(OrdersTotal() > 1) //searching for last opening order
   {
   int OrderPosition = 0;

   while(OrderPosition < OrdersTotal())
      {
      if( OrderSelect(OrderPosition, SELECT_BY_POS, MODE_TRADES)&& OrderSymbol() == Symbol() && OrderType() == OP_SELL )
       {
        if(  OrderMagicNumber() == MagicNo)
        lastorder=1;
       }
      OrderPosition++;
      
      }
   }
Reason: