Questions from Beginners MQL4 MT4 MetaTrader 4 - page 68

 
I put the code in the right way and I don't see it.
 

//|                                          9.1.4.5 OrderDelete.mq4 |
//|                        Copyright 2016, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2016, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+1
void OnStart()
{
  string Symb=Symbol();        //Финансовый инструмент
  double Dist=1000000.0;       //Предустановка
  double Price;
  int  Limit_Stop=-1;          // Пока отложенных нет
  int Tip;
  double Win_Price=WindowPriceOnDropped();     //Здесь брошен скрипт
  //-------------------------------------------------------------------+2
  for(int i=1; i<=OrdersTotal(); i++)         // Цикл выбора ордеров
  {  
    if(OrderSelect(i-1, SELECT_BY_POS)==true)    //Eсли ордер выбран
      {
        //------------------------------------------------------------------+3      
        if(OrderSymbol()!=Symb) continue   //не ваш фин. инструмент
        int Tip=OrderType();               //Тип ордера
        if(Tip<2) continue                 //Рыночный ордер
      
        //------------------------------------------------------------+4
        double Price=OrderOpenPrice();     //Цена откр. отлож. ордера
          if(NormalizeDouble(MathAbs(Price-Win_Price),Digits)<
            NormalizeDouble(Dist,Digits))
            {
            Dist=MathAbs(Price-Win_Price);     // Новое значение
            Limit_Stop=Tip;                    //Есть отложенный ордер
            int Ticket=OrderTicket();            // номер ордера
            }
      }
  
  
  //+---------------------------------------------------------------+5
  switch(Limit_Stop)
  {
  case 2: string Texst="BuyLimint ";
         break;
  case 3: Texst="SellLimint ";
         break;
  case 4 Texst="BuyStop ";
         break;
  case 5 Texst="SellStop ";
         break;
  }
  
  //------------------------------------------------------------------+6
  //ЦИКЛ ЗАКРЫТИЯ  ОРДЕРА
  //--------------------------------------------------------------------
  while(true)              // цикл закрытия ордера
  {
  if(Limit_Stop==-1)       //если отложенных нет
    {
    Alert("по ",Symb,"отложенных ордеров");   //если отложенных нет
    break;
    }
    //-----------------------------------------------------------------+7
    Alert("Попытка удалить ","",Ticket,"ожидание ответа..");
    bool  Ans=OrderDelete(Ticket);              //Удаление ордера
    //---------------------------------------------------------------------
    if(Ans==true)
    {
    Alert("Удалён ордер ",Text,"",Ticket);
    break;
    }
    int Error=GetLastError();
    switch(Error)
    {
    case 4:Alert("Торговый сервер занят. Пробуем ещё раз..");
     Sleep(3000);                                 //Обновим данные
     continue;                                     //На следующую итерацию
    case 137:Alert("Брокер занят. Пробуем ещё раз...");
            Sleep(3000);
            continue;
    case 146:Alert("Подсистема торговли занята. Пробуем ещё раз...");
            Sleep(500);
            continue;                             // На следующую итерацию
    }
    switch(Error)                                  //Критические ошибки
     {
     case 2:Alert("Oбщая ошибка.");
            break;                               //Выход из switch
  
     case 64:Alert("Счёт заблокирован.");
            break;                               //Выход из switch                                    
     case 133:Alert("Торговля заблакирована.");
            break;
     case 139:Alert(" Ордер заблакирован и уже обрабатывается.");
            break;
     case 145:Alert("Модификация запрещена.Ордер слишком близок к рынку");
            break;      
     default:Alert("Возникла ошибка.",Error);    //Другие варианты                                                               //Выход из switch      
     }
     break;                                
   }
   //---------------------------------------------------------------------+
   Alert("Скрипт законччил работу-----------------------.");
   return;
}

  
guys take a look
 
two errors came up on the onstart brackets. it looks like a bracket is missing in the for loop, I put 11 errors, miracle!!!!
 
 
FOTOGRAF14:
I got two errors on the onstart brackets. it looks like there is a bracket missing in the for loop, I put 11 errors in the loop, miracle!!!
Don't think that increasing the number of errors is wrong! The bracket in for is really needed. It's just this error that needs to be fixed first of all. After fixing it, apparently there are more errors :)
 
FOTOGRAF14:
I got two errors on the onstart brackets. it looks like a bracket is missing in the for loop, I put 11 errors, miracle!!!!
Miracles don't happen..."')' - "unexpected end of program" - unexpected end... "'{' - unbalanced parentheses" - uncovered parentheses... = incomplete parentheses, '{' is missing or unnecessary ... need to check code carefully and add where needed, not just or remove an extra one. ...
 
FOTOGRAF14:

Pages 25, 27, - semicolon missing.

Pages 44, 48, 50, 69, - Texst, the compiler does not understand what it is, 'Text' is not a declared identifier = it must be dealt with.

Pages 48, 50, - operand expected = most likely a colon is missing.

Page 64 - Ticket = not declared identifier.

And so on, sort out your errors.

 
FOTOGRAF14:
I'm just pasting the code as it should be but I don't see it.

you have to type something like

***

forum glitch

 
FOTOGRAF14:

  
guys take a look

Why are you skipping the last order - is that the intention?

for(int i=1; i<=OrdersTotal(); i++)         // Цикл выбора ордеров
  {  
    if(OrderSelect(i-1, SELECT_BY_POS)==true)    //Eсли ордер выбран
      {


 
in the terminal - news tab. how do I change the size of the pop-up window and the font size within it so that these changes are retained when I exit the terminal and then log in?