Errors, bugs, questions - page 2931

 

On 10, the memory consumption of the Terminal is shown to be high. On Windows Server it is much less.

Apparently the calculation of memory consumption depends on the OS.

 
fxsaber:

This is the kind of feature that, even if you knew it, you have to bring up the whole layer in your head all over again.

Here I was making a self-reported presence determination. It seemed to work when switching TFs.

I didn't really get into it, but judging by these lines:

    const int Total = ::IndicatorParameters(handle, Type, Params);
    ::IndicatorRelease(handle);

    uchar Bytes[];

    for (int i = 1; i < Total; i++)
    {
      ::ArrayCopy(Bytes, _R(Params[i].double_value).Bytes, ::ArraySize(Bytes));
      ::ArrayCopy(Bytes, _R(Params[i].integer_value).Bytes, ::ArraySize(Bytes));
      ::ArrayCopy(Bytes, _R(Params[i].string_value).Bytes, ::ArraySize(Bytes));
    }

indicator name (in the 0th parameter) is not used in creating the signature, which is quite strange.

 
fxsaber:

On 10, the memory consumption of the Terminal is shown to be high. On Windows Server it is much less.

Apparently the calculation of memory consumption depends on the OS.

Rather, the memory reservation on the server axes is more optimal.
 
Stanislav Korotky:

I didn't really get into it, but judging from these lines:

the indicator name (in parameter 0) is not used in creating the signature, which is quite strange.

return("::" + (string)::ChartID() + (string)INIT_SYNC::crc64(Bytes) + ::MQLInfoString(MQL_PROGRAM_NAME));
 
fxsaber:

Yes, I have encountered it. Validate starts the first pass, the following ones do not. Start button doesn't start.

Debugged - it runs. Did debugging in release, everything is supposedly fine, but it doesn't work.


Now I specially launch debug version. It presses the Start button without any problems.

Couldn't figure out the reason for the bug.

Heh recently saw this answer.

As I understand it's my local agents not starting, why not figured out. It seems to start better in the latest versions of the terminal.

 
fxsaber:

On 10, the memory consumption of the Terminal is shown to be high. On Windows Server it is much less.

Apparently, calculation of memory consumption depends on OS.

I have a feeling that the server is not quite correct on Windows Server.

Or, more precisely, graphics settings are constantly being reset and it depends on memory shortage. At the same time everything seems to be normal in dispatcher. Either vpc is limited or mt5 is more voracious.

 
Print(PERIOD_H4);

gives a result of 16388. How can I do the reverse procedure: substitute the value 16388 and get a string with the period namePERIOD_H4? Is there a built-in function or should I write my own converter? If there is no built-in function, what would a custom function look like? Would it be necessary to write something like a key-value match?

Документация по MQL5: Константы, перечисления и структуры / Константы графиков / Периоды графиков
Документация по MQL5: Константы, перечисления и структуры / Константы графиков / Периоды графиков
  • www.mql5.com
Периоды графиков - Константы графиков - Константы, перечисления и структуры - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
x572intraday:

gives a result of 16388. How can I do the reverse procedure: substitute the value 16388 and get a string with the period namePERIOD_H4? Is there a built-in function or should I write my own converter? If there is no built-in function, what would a custom function look like? Would it be necessary to write something like a key-value match?

Print(EnumToString((ENUM_TIMEFRAMES)16388));
 
fxsaber
Print(EnumToString((ENUM_TIMEFRAMES)16388));

It turns out there is. That's a relief. Thank you.

 

I am trying to allow the user to select both timeframes and their number from the menu of the indicator setup window:

enum PERIOD
  {
   NO_PERIOD=0,      // NOT USED
   P1=PERIOD_H1,     // H1 
   P2=PERIOD_H2,     // H2 
   P3=PERIOD_H4,     // H4 
  };

input PERIOD TIMEFRAME_1=P1;
input PERIOD TIMEFRAME_2=P2;
input PERIOD TIMEFRAME_3=P3;

ENUM_TIMEFRAMES PArray[3]={P1,P2,P3};

and I want the selected periods to go directly to PArray. But from the above example it turns out that I assign to the array the values pre-set in the program and not the values entered by a user. In addition, the compiler generates warnings:

implicit conversion from 'enum PERIOD' to 'enum ENUM_TIMEFRAMES'        test.mq5        23      28
   'ENUM_TIMEFRAMES::PERIOD_H1' will be used instead of 'PERIOD::P1'    test.mq5        23      28
implicit conversion from 'enum PERIOD' to 'enum ENUM_TIMEFRAMES'        test.mq5        23      31
   'ENUM_TIMEFRAMES::PERIOD_H2' will be used instead of 'PERIOD::P2'    test.mq5        23      31
implicit conversion from 'enum PERIOD' to 'enum ENUM_TIMEFRAMES'        test.mq5        23      34
   'ENUM_TIMEFRAMES::PERIOD_H4' will be used instead of 'PERIOD::P3'    test.mq5        23      34

When I try to replace the last line with:

ENUM_TIMEFRAMES PArray[3]={TIMEFRAME_1,TIMEFRAME_2,TIMEFRAME_3};

the compiler generates an error altogether:

'TIMEFRAME_1' - constant expression required    test.mq5        23      28
'TIMEFRAME_2' - constant expression required    test.mq5        23      40
'TIMEFRAME_3' - constant expression required    test.mq5        23      52

Also, NO_PERIOD=0 meansPERIOD_CURRENT, and I don't need that, I need something like false or EMPTY_VALUE, but they don't fit at all.

How to fix it?

Документация по MQL5: Константы, перечисления и структуры / Константы графиков / Периоды графиков
Документация по MQL5: Константы, перечисления и структуры / Константы графиков / Периоды графиков
  • www.mql5.com
Периоды графиков - Константы графиков - Константы, перечисления и структуры - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5