Errors, bugs, questions - page 315

 

Next problem.

After reinstalling OS and new MT5 installation, custom indicators that worked before stopped loading.

Re-checked the parameters - everything is correct.

Then I tried to load one of the standard indicators through iCustom, putting it in the root Indicators folder,

but the code below, when "#include" is present, causes a loading error, though:

- there are no errors on included classes,

- the code involving these classes is disabled for simpler understanding of the error, and previously it worked fine,

- without enabling #include the error of loading a custom indicator does not occur.

#include <..\Experts\_My\Classes\ClassExpert\ClassExpert.mqh>

void OnInit(){
   int HandleIndicator = iCustom(_Symbol,_Period,"RSI",14);                      
   Print("HandleIndicator = ", HandleIndicator);
   if(HandleIndicator==INVALID_HANDLE){
      Print("Handle of RSI is INVALID_HANDLE");
      return;
   };
}

2011.02.23 09:52:41     Core 1  expert removed self when OnInit called
2011.02.23 09:52:41     Core 1  2011.01.14 00:00:00   Handle of RSI is INVALID_HANDLE
2011.02.23 09:52:41     Core 1  2011.01.14 00:00:00   HandleIndicator = -1
2011.02.23 09:52:41     Core 1  2011.01.14 00:00:00   expert removed because custom indicator 'RSI' cannot load [4802]
2011.02.23 09:52:41     Core 1  loading of RSI EURUSD,H1 failed

I can't understand what's wrong at all.

The same thing happens in the usual way, using classes:

#include <..\Experts\_My\Classes\ClassExpert\ClassExpert.mqh>
ClassExpert Expert1;
void OnInit(){
   Expert1.Init();
   //---
   int HandleIndicator = iCustom(_Symbol,_Period,"RSI",14);                      
   Print("HandleIndicator = ", HandleIndicator);
   if(HandleIndicator==INVALID_HANDLE){
      Print("Handle of RSI is INVALID_HANDLE");
      return;
   };
}

And this is despite the fact that the MT5 build 401 version currently in use worked without errors with this code on both home and office PCs (on which it still works).

 
DV2010:

Next problem.

After reinstalling OS and new MT5 installation, custom indicators that worked before stopped loading.

Re-checked the parameters - everything is correct.

Then I tried to load one of the standard indicators through iCustom, putting it in the root Indicators folder,

but the code below, in the presence of "#include" leads to an error of loading, although there are no errors in the included classes,

the code with them to simplify the understanding of the error reasons is not used now, while previously it worked fine:

- causes a load error:

I can't figure out what's wrong at all.
Please write to Service Desk and attach all source files. I've tried to reproduce it in mine, but it doesn't work - I don't have your include files.
 
Rosh: Пожалуйста, напишите в Сервисдеск и приложите все исходники. Я пытался воспроизвести у себя, но не получилось - у меня нет ваших включаемых файлов. 

Rosh, thank you, but by moving from the simplest model with a minimum of code to the full one by successive inclusion of separate parts of the code I managed to return a working version (otherwise I would have had to attach more than fifty of my files, because the system refused to accept the rar archive). However, to be honest, I did not understand what exactly the error was.

 
DV2010:

(otherwise I would have had to attach more than fifty of my own files, as the system refused to accept rar archives).


Maximum downloadsize: 16 MB, no more than 10 attachments (.gif .png .jpg .jpeg .zip.txt .log .mqh .ex5 .mq5 .mq4 .ex4 .flv .mt5)
 

Hello, today when writing a number in double format in global variables terminal (manually) 88.71 after pressing Enter, I see the value 88.709999999, while in another global variable record 87.80 and after pressing Enter value took, as it should, 87.8. And when writing a value with 4 decimal places, I receive a value with 4 characters. Build 401.

P.S. In principle, this representation of the number to read the expert is likely to be perceived as intended, but to read a person somehow not nice.

Документация по MQL5: Основы языка / Переменные / Глобальные переменные
Документация по MQL5: Основы языка / Переменные / Глобальные переменные
  • www.mql5.com
Основы языка / Переменные / Глобальные переменные - Документация по MQL5
 
kirill190982:

Hello, today when writing a number in double format in global variables terminal (manually) 88.71 after pressing Enter see the value of 88.709999999, while in another global variable record 87.80 and after pressing Enter value took, as it should, 87.8. And when writing a value with 4 decimal places, I receive a value with 4 characters. Build 401.

P.S. In principle, this representation of the number to read the expert is likely to be perceived as intended, but to read a person somehow not nice.

https://www.mql5.com/ru/docs/basis/types/double

https://www.mql5.com/ru/articles/1561

Документация по MQL5: Основы языка / Типы данных / Вещественные типы (double, float)
Документация по MQL5: Основы языка / Типы данных / Вещественные типы (double, float)
  • www.mql5.com
Основы языка / Типы данных / Вещественные типы (double, float) - Документация по MQL5
 

Thank you, but I would like to see the numbers in their usual form and let the machine count the numbers as it should

 
kirill190982:

Thank you, but I would like to see the numbers in their usual form and let the machine count the numbers as it should

https://www.mql5.com/ru/docs/convert/doubletostring

no perfection in the world....

Документация по MQL5: Преобразование данных / DoubleToString
Документация по MQL5: Преобразование данных / DoubleToString
  • www.mql5.com
Преобразование данных / DoubleToString - Документация по MQL5
 
AlexSTAL:

https://www.mql5.com/ru/docs/convert/doubletostring

there is no perfection in the world....

There is :) There is nothing wrong with this issue in VB.NET. Although, I remember what you said about the size of Microsoft's staff :)
 
-Alexey-:
There is :) There's nothing wrong with this issue in VB.NET.

The question is at what cost ))))

Often we only see the tip of the iceberg....

http://msdn.microsoft.com/ru-ru/library/system.decimal.aspx

P.S. There is no way to implement this in the normal way! You have to understand how floating point numbers are stored for that! You can only go for artificial tricks....

Decimal - структура (System)
Decimal - структура (System)
  • msdn.microsoft.com
Пространство имен: System Сборка: (в mscorlib.dll) Тип предоставляет следующие члены. ИмяОписание В начало страницы ИмяОписание (Переопределяет ValueTypeEquals(Object).) Преобразует заданное 64-разрядное целое число со знаком, соответствующее значению денежного типа OLE-автоматизации, в эквивалентное значение типа...
Reason: