'\end_of_program' - unbalanced left parenthesis - page 2

 
krishna_gopal_2:


I am trying an EA. While closing or removing the EA, it should delete all pending orders and close all orders opened by it.

Can you give me a code for this?

Deinit could try, but it must return withing two seconds and server calls can take much longer.
 

helow i need help i try to code a robot but when i try to compile it says error  but end of program here is my coding can you help


 void OnTick()

  {

     // if we have no open orders

     if (OrdersTotal()<1)

     

     {

        //we open a demo buy trade for 10 microlot

        int buyticket = OrderSend(Symbol(),OP_BUY,0.10,Ask,3,0,0,NULL,0,0,Green);

     }

 

        // we count all the orders

        for (int b= OrdersTotal()-1;b>=0;b>=0;b--)

         {

            // we select one of the orders

            if (OrderSelect(b,SELECT_BY_POS,MODE_TRADES)) 

               // we check if the order belongs to the current chart

               if (OrderSymbol()==Symbol())

                  // if it is a buy order 

                  if (OrderType()==OP_BUY)

                     {

                        // if the stop loss is below 150 points

                        if (OrderStopLoss() <Ask - (150* _Point))

                           // we modify the stop sloss                                                                 |

                           OrderModify{

                                     

                                         OrderTicket(),          // for current order

                                         OrderOpenPrice(),       // opened for the OpenPrice

                                         Ask - (150* _Point),    // set stop loss

                                         OrderTakeProfit(),      // unchange take profit 

                                         0,                      // no expiration

                                         CLR_NONE                // no color

                                       ) ;

                                  

                     {

                

     // for End 

                                

                     

                      

                      

      }               

 
Khumiso Skhumza #:

helow i need help i try to code a robot but when i try to compile it says error  but end of program here is my coding can you help


void OnTick()

{

// if we have no open orders

   if (OrdersTotal()<1)



   {

      //we open a demo buy trade for 10 microlot

      int buyticket = OrderSend(Symbol(),OP_BUY,0.10,Ask,3,0,0,NULL,0,0,Green);

   }



// we count all the orders

   for (int b= OrdersTotal()-1; b>=0; b>=0; b--)

   {

      // we select one of the orders

      if (OrderSelect(b,SELECT_BY_POS,MODE_TRADES))

         // we check if the order belongs to the current chart

         if (OrderSymbol()==Symbol())

            // if it is a buy order

            if (OrderType()==OP_BUY)

            {

               // if the stop loss is below 150 points

               if (OrderStopLoss() <Ask - (150* _Point))

                  // we modify the stop sloss                                                                 |

                  OrderModify{



                  OrderTicket(),          // for current order

                  OrderOpenPrice(),       // opened for the OpenPrice

                  Ask - (150* _Point),    // set stop loss

                  OrderTakeProfit(),      // unchange take profit

                  0,                      // no expiration

                  CLR_NONE                // no color

                  ) ;



                  {



                     // for End






                  }                    }

            }
   }
}
 
Arpit T #:
for (int b= OrdersTotal()-1;b>=0;b>=0;b--)
  1. Don't double post! You already had this thread open.
              General rules and best pratices of the Forum. - General - MQL5 programming forum #6 (2017)

  2. Don't hijack other threads for your off-topic post. Next time, make your own, new, thread.

  3. Do not post code that will not even compile. Perhaps you should read the manual.
       How To Ask Questions The Smart Way. (2004)
          How To Interpret Answers.
             RTFM and STFW: How To Tell You've Seriously Screwed Up.