Errors, bugs, questions - page 2913

 
Konstantin Seredkin:

I have it hanging all the time until I unload it myself, when I took the screenshot, using MT5 was finished on Saturday morning when the market closed in my time zone, on Sunday I sat down to play games and started killing processes.

Probably the problem is on my end, although the license was reinstalled a month ago.

Take a dump of the "hanging" agent. Let's have a look.

 
DMITRII PECHERITSA:
compile fail with ternary operator
compile fail with ternary operator ?


any suggestions?
why?

Ternary operator does not cast to base class implicitly

Use explicit casting

interface A{};
class B:public A{};
class C:public A{};
void OnStart(void)
  {
   A* x=(true)? (A *)new B : (A *)new C; //invalid cast operation
  }


The ternary operator does not cast operands to the base class implicitly - use explicit casting.

 
A100:
There is no error message:

but that's the way it is:

What's the fundamental difference?

In the first case there should have been an error message too - the function name is already used for enumeration.

 

Dear developers, please add the ability to run scripts from other scripts and services in synchronous mode.

Thank you in advance

 
Aliaksandr Hryshyn:

Dear developers, please add the ability to run scripts from other scripts and services in synchronous mode.

Thank you in advance.

I support, it is not convenient to work with big files from EA for some reasons, I use scripts which have to run dozens in parallel to load all cores and speed up calculation.

 
Good afternoon. Please advise, I can't import a CSV file into the database via ME navigator. It says: import database error. Tried all the CSV options. Has anyone managed to do this or is this a bug? Version: 5.0 build 27.15.
 

If you change EX5, when you open previously received opt-files of this EA, the input parameters of the passes disappear.

Please show them at all times!

 

There is such a warning in the Signal.

What can this be connected to? The account access details have not been changed.

 
fxsaber:

There is such a warning in the Signal.

What can this be connected to? The account access details have not been changed.


It happens periodically. Then it will reconnect. There is no need to do anything.

 
Alexey Viktorov:

You don't need to understand me, you need to understand the documentation. I suggested sorting based on the list of orders or positions. And also in one of the topics Slava said that it's enough, just hide the object and display it again, so that it was above all the others and received the "rat's click" event first. If wrong, sorry. Figure out how the list is sorted and tell everyone. I'll change my mind too.

After long struggles and experiments, I believe there is a bug in MQL5 with sorting of objects in the list of objects. For I've tried this code in MQL4 without any special hope for correct processing, I've discovered that 4 sequentially created Fibo levels have correct numbering in the object list: 0.1.2.3. The first ==0, the second ==1, etc.., In MQL5, however, 4 consecutive symbols created one after another have numbering from the ceiling, and only if I change their names, they line up in the order of changing their names. What should I do? Check my terminal, maybe my terminal is not working properly, although I've tried it on 3 computers (((()).

//+------------------------------------------------------------------+
//|                                                            F.mq5 |
//|                        Copyright 2020, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//|                                                  Fibo_Massiv.mq5 |
//|                        Copyright 2020, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
string NameFiboUp[15];                               // Объявление массива
string NameFiboDown[15];                               // Объявление массива
string NameFibo[9];                               // Объявление массива


//+------------------------------------------------------------------+
int OnInit()
  {
//---
   NameFiboUp[1]="FiboUp1 ";
   NameFiboDown[1]="FiboDown1 ";
   NameFiboUp[2]="FiboUp2 ";
   NameFiboDown[2]="FiboDown2";
   NameFiboUp[3]="FiboUp3";
   NameFiboDown[3]="FiboDown3 ";
   NameFiboUp[4]="FiboUp4 ";
   NameFiboDown[4]="FiboDown4 ";
   NameFiboUp[5]="FiboUp5";
   NameFiboDown[5]="FiboDown5 ";
   NameFiboUp[6]="FiboUp6 ";
   NameFiboDown[6]="FiboDown6 ";
   NameFiboUp[7]="FiboUp7 ";
   NameFiboDown[7]="FiboDown7 ";
   NameFiboUp[8]="FiboUp8 ";
   NameFiboDown[8]="FiboDown8 ";
   NameFiboUp[9]="FiboUp9 ";
   NameFiboDown[9]="FiboDown9 ";
   NameFiboUp[10]="FiboUp10 ";
   NameFiboDown[10]="FiboDown10";
   NameFiboUp[11]="FiboUp11 ";
   NameFiboDown[11]="FiboDown11 ";
   NameFiboUp[12]="FiboUp12 ";
   NameFiboDown[12]="FiboDown12 ";
   NameFiboUp[13]="FiboUp13 ";
   NameFiboDown[13]="FiboDown13";
   NameFiboUp[14]="FiboUp14 ";
   NameFiboDown[14]= "FiboDown14";
//---------------------------------------------
   NameFibo[1]="M1";
   NameFibo[2]="M5";
   NameFibo[3]="M15";
   NameFibo[4]="H1";
   NameFibo[5]="H4";
   NameFibo[6]="Da";
   NameFibo[7]="We";
   NameFibo[8]="Mo";
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   int UP=1;
   int Down=1;
   string  nameUP   = "FiboUp";
   string  nameDown = "FiboDown";
   double FiboDown[4][10],FiboUp[4][10];  // 2x мерный  массив
//  Alert("ArraySize(FiboDown)= ", ArraySize(FiboDown));
   int Fibo_Koll = ObjectsTotal(0,0,OBJ_FIBO);     //Запрос колличества объектов Fibo

//_________________________________________________________
   if(Fibo_Koll==0) //Если нет не одного фибо выход        //
      return;                                              //
//_________________________________________________________//

   int Koll[];  //Индексация и запись в массив по порядку появления фибо в окне инструментов
   int Tip[];    //Запись типа Fibo в массив по порядку появления фибо в окне инструментов
   ArrayResize(Koll,Fibo_Koll); // Устанавливает новый размер в первом измерении массива Koll []
   ArrayResize(Tip,Fibo_Koll);  // Устанавливает новый размер в первом измерении массива Tip []


   for(int i=0; i < Fibo_Koll; i++)
     {
      string n=ObjectName(0,0,0,OBJ_FIBO);

      //--------------------------------------------------------

      //----------------------------------------------------------------------------------------
      double   Fibo_Level_0= ObjectGetDouble(
                                0,          // идентификатор графика
                                n,              // имя объекта
                                OBJPROP_PRICE,           // идентификатор свойства
                                0     // модификатор свойства
                             );


      double   Fibo_Level_1= ObjectGetDouble(
                                0,          // идентификатор графика
                                n,              // имя объекта
                                OBJPROP_PRICE,           // идентификатор свойства
                                1     // модификатор свойства
                             );
      //------------------------------------------------------------------------------------------------------
      if(Fibo_Level_0>Fibo_Level_1)
        {

         //вызов функции расчёта уровня 78.6
         double Fibo_78_Up = Function_Up(Fibo_Level_0, Fibo_Level_1);
         //Изменение имени объекта
         /*   bool l =  StringSetLength(      //Устанавливает для  строки указанную длину в символах 2
                         n,       // строка
                         2    // новая длина строки
                      );
            //-----------------------------------------------------------
            int N = 1;
            string q;

            for(int e = 1; N != 0; e++) // пока N не == 0, гоняем функцию StringCompare. сравнивая обрезанную переменную(StringSetLength) с массивом NameFibo[]
              {
               N= StringCompare(
                     n,              // первая сравниваемая строка
                     NameFibo[e],    // вторая сравниваемая строка
                     true      // режим учета регистра букв при сравнении
                  );

               q= NameFibo[e];

              }
            n= q+NameFiboUp[1];*/


         //--------------------------------------------------------------------
         FiboUp[UP][1]=1;    // Тип обектов 1 == FiboUp
         FiboUp[UP][2]=UP;     // Нумерация обектов FiboUp по типу
         FiboUp[UP][3]=Fibo_78_Up;   // 78.6%
         FiboUp[UP][4]=0;       // 61.8%
         FiboUp[UP][5]=0;         // 50%
         //----------------------------------------------------------------------------------------------------------
         bool  F =ObjectSetString(0,n,OBJPROP_NAME,NameFiboUp[UP]);

         UP++;
        }
      //----------------------------------------------------------------------------------
      else
        {
         //вызов функции расчёта уровня 78.6
         double Fibo_78_Down = Function_Down(Fibo_Level_0, Fibo_Level_1);
         //Изменение имени объекта
         /*     bool l =  StringSetLength(      //Устанавливает для  строки указанную длину в символах 2
                           n,       // строка
                           2    // новая длина строки
                        );
              //-----------------------------------------------------------
              int N = 1;
              string q;

              for(int e = 1; N != 0; e++) // пока N не == 0, гоняем функцию StringCompare. сравнивая обрезанную переменную(StringSetLength) с массивом NameFibo[]
                {
                 N= StringCompare(
                       n,              // первая сравниваемая строка
                       NameFibo[e],    // вторая сравниваемая строка
                       true      // режим учета регистра букв при сравнении
                    );

                 q= NameFibo[e];

                }
              n= q+NameFiboUp[1];*/

         //-------------------------------------------------------------------
         FiboDown[Down][1]=2;    // // Тип обектов 2 == FiboDown
         FiboDown[Down][2]=Down;     // Нумерация обектов  по типу
         FiboDown[Down][3]=Fibo_78_Down;   // 78.6%
         FiboDown[Down][4]=0;       // 61.8%
         FiboDown[Down][5]=0;         // 50%
         //------------------------------------------------------------------
         //Изменение имени объекта
         bool  F =ObjectSetString(0,n,OBJPROP_NAME,NameFiboDown[Down]);


         Down++;

        }
     }
//+------------------------------------------------------------------+

   ArrayPrint(
      FiboUp,             // выводимый массив
      2,      // количество десятичных знаков после запятой
      NULL,      // разделитель между значениями полей структуры
      0,             // индекс первого выводимого элемента
      WHOLE_ARRAY,   // количество выводимых элементов
      ARRAYPRINT_HEADER|ARRAYPRINT_INDEX|ARRAYPRINT_ALIGN
   );

   ArrayPrint(
      FiboDown,             // выводимый массив
      2,      // количество десятичных знаков после запятой
      NULL,      // разделитель между значениями полей структуры
      0,             // индекс первого выводимого элемента
      WHOLE_ARRAY,   // количество выводимых элементов
      ARRAYPRINT_HEADER|ARRAYPRINT_INDEX|ARRAYPRINT_ALIGN
   );

  }
// for(int i=0; i<ArraySize(Koll); i++)
//  printf("Koll[%d] = %d",i,Koll[i]);


//------------------------------------------------------------------------------------------------------

//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
double Function_Up(double a, double b)    // имя функции и список параметров
  {
   double Sum_100 = a - b; //Вычисляем 100% В пунктах от точек построения фибо
   double Sum_78  = Sum_100 * 78.6 / 100;  //Вычисляем 78.6% В пунктах
   return (Sum_78 + b);           // Вычисляем 78.6% в цене инструмента
  }
//+------------------------------------------------------------------+
double Function_Down(double a, double b)    // имя функции и список параметров
  {
   double Sum_100 = b - a ; //Вычисляем 100% В пунктах от точек построения фибо
   double Sum_78  = Sum_100 * 21.4 / 100;  //Вычисляем 78.6% В пунктах
   return (Sum_78 + a);           // Вычисляем 78.6% в цене инструмента
  }
//+------------------------------------------------------------------+
Reason: