Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1012

 

Tell me if this makes sense:

IndicatorSetInteger(INDICATOR_DIGITS,_Digits+1)
 
Сергей Таболин:

Tell me if this makes sense:

It's like arguing about the tastes of felt-tip pens.

 

Can you tell me if resizing a dynamic array using the ArrayResize function should not decrease the amount of memory used by the EA? ( I check it using the MQLInfoInteger(MQL_MEMORY_USED) function

Here is the code:

Print("Первый ArrayResize вернул ",ArrayResize( TickTemp, 1000000, 0 ));
Print("Размер массива после ПЕРВОГО ArrayResize ",ArraySize( TickTemp ),"  Используем памяти. ",MQLInfoInteger(MQL_MEMORY_USED));
    
Print("Второй ArrayResize вернул ",ArrayResize( TickTemp, 500000, 0 ));
Print("Размер массива после ВТОРОГО ArrayResize ",ArraySize( TickTemp ),"  Используем памяти. ",MQLInfoInteger(MQL_MEMORY_USED));

Here is the result:

Первый ArrayResize вернул 1000000
Размер массива после ПЕРВОГО ArrayResize 1000000  Используем памяти. 58

Второй ArrayResize вернул 500000
Размер массива после ВТОРОГО ArrayResize 500000  Используем памяти. 58

Frankly speaking, the result is a bit unexpected for me. I expected the program to use twice less memory in the second case.

 
Is it possible to apply your own template for visualisation in the tester? Not a template with the name of the expert, but a default one.
 
Сергей Таболин:
Is it possible to apply your own template for visualisation in the tester? Not a template with the name of the expert, but by default.

Open a new timetable. Sketch something on it. Right-click on the resulting chart - Save template ... -> tester.tpl

Now visual testing will run with the template you created.

 
Vladimir Karputov:

Open a new timetable. Sketch something on it. Right-click on the resulting chart - Save template ... -> tester.tpl

Now visual testing will run with the template you created.

Thank you very much.

 
Another question. How can I programmatically check for a custom indicator without using iCustom ? Like FileIsExist.
 
Сергей Таболин:
Another question. How can I programmatically check for a custom indicator without using iCustom ? Like FileIsExist.

Request the total number of indicators on the chart and search in the loop by short indicator name.

 
Alexey Viktorov:

Query the total number of indicators on the chart and search in the loop for the short indicator name.

Clarification. Not on the chart, but in general. To find out if there is an indicator in the "set". In the indicators folder.

Here, for example, I have my indicator A that uses another custom indicator B. If A does not get the handle of B when I start it, A will not start.

But if I start an owl using A, then A does not start and the owl does not close despite:

   handle_A = iCustom(Symbol(),0,"my_used\\my_A7C");
   if(handle_A == INVALID_HANDLE)                                   // проверяем наличие хендла индикатора
   {
      Print("Не удалось получить хендл индикатора handle_A");       // если хендл не получен, то выводим сообщение в лог об ошибке
      return(INIT_FAILED);                                          // завершаем работу с ошибкой
   }
   else
   {
      Print("Получен хендл индикатора handle_A");
      ChartIndicatorAdd(ChartID(),0,handle_A);                      // подключаем индикатор к графику
   }
 
Сергей Таболин:

Clarification. Not on the chart, but in general. To find out if the indicator is in the "set". In the indicators folder.

Can you also clarify what this is for?

Reason: