hi community

 

i am basic programmer anyone help me

whenever i will get any close order then immediately i have to open one buy and sell for the same currency

But my codings are working

first two orders closing then will be immediately open my new buy and sell order

here my codings

void OnTick()

  {

//---

    for (int i=0; i<=OrdersTotal(); i++)       //Cycle for all orders..

     { 

     if( i == OrdersTotal())//If there is the next one

        {                                     

         OrderSend(_Symbol,OP_BUY,0.02,Ask,3,NULL,Bid+100*_Point);

   OrderSend(_Symbol,OP_SELL,0.02,Bid,3,NULL,Ask-100*_Point);

        }

        return;

     }                           

  }


how ?

 
vargeese7:

i am basic programmer anyone help me

whenever i will get any close order then immediately i have to open one buy and sell for the same currency

But my codings are working

first two orders closing then will be immediately open my new buy and sell order

here my codings

void OnTick()

  {

//---

    for (int i=0; i<=OrdersTotal(); i++)       //Cycle for all orders..

     { 

     if( i == OrdersTotal())//If there is the next one

        {                                     

         OrderSend(_Symbol,OP_BUY,0.02,Ask,3,NULL,Bid+100*_Point);

   OrderSend(_Symbol,OP_SELL,0.02,Bid,3,NULL,Ask-100*_Point);

        }

        return;

     }                           

  }


how ?

Hi,

start by using Alt+S when posting code

insert_code _correct

Reason: