Download MetaTrader 5

Modify orders

To add comments, please log in or register
Ganesh Kumar
18
Ganesh Kumar  
I want to modify stop loss and take profit to zero in hegde any one explain please how it is possible
whroeder1
16755
whroeder1  
Ganesh Kumar: I want to modify stop loss and take profit to zero
Right click on the line.
Ganesh Kumar
18
Ganesh Kumar  
whroeder1:
Right click on the line.

Thanks for your reply. I just need a code to modify previous order of similar symbol in ea.

I try this code too.

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

      {

         if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))

         {

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

            {

               tempcount++; 

               if(tempcount == count)

              {   

                      if(OrderType() == OP_BUY)

                      {

                                    modify = OrderModify(OrderTicket(),OrderOpenPrice(),0,0,0,clrRed);

                                    placeorder();

                                    break;

                              }

                           }

                       }

}

}


This code works. But it modify the previously opened order not similar symbol  which  it currently placed.

whroeder1
16755
whroeder1  
Ganesh Kumar: I just need a code to modify previous order of similar symbol in ea. But it modify the previously opened order not similar symbol  which  it currently placed.
  1. Please use
SRC
    Play video
    Please edit your post.
    For large amounts of code, attach it.

  2. In the presence of multiple orders (one EA multiple charts, multiple EAs, manual trading)
  3. Drop your counting code. Either you want all open orders to have a SL or you don't. If you don't, then change orders that do.
  4. What you wrote above is unintelligible.
Ganesh Kumar
18
Ganesh Kumar  
Ganesh Kumar:

Thanks for your reply. I just need a code to modify previous order of similar symbol in ea.

I try this code too.

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

      {

         if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))

         {

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

            {

               tempcount++; 

               if(tempcount == count)

              {   

                      if(OrderType() == OP_BUY)

                      {

                                    modify = OrderModify(OrderTicket(),OrderOpenPrice(),0,0,0,clrRed);

                                    placeorder();

                                    break;

                              }

                           }

                       }

}

}


This code works. But it modify the previously opened order not similar symbol  which  it currently placed.


whroeder1:
  1. Please edit your post.
    For large amounts of code, attach it.

  2. In the presence of multiple orders (one EA multiple charts, multiple EAs, manual trading)
  3. Drop your counting code. Either you want all open orders to have a SL or you don't. If you don't, then change orders that do.
  4. What you wrote above is unintelligible.

Ganesh Kumar
18
Ganesh Kumar  

Ganesh Kumar:

If you can't understand means, my question is not unintelligable. Thanks for your reply.

To add comments, please log in or register