Errors, bugs, questions - page 2781

 

the 3rd class painting crew asked me to tell the abstractionist painterhttps://www.mql5.com/ru/forum/343547

who did not paint the brackets in the ME correctly, that something should be done about it, or there is a suggestion to take away the brushes and knock on the easel

 
Sergey Dzyublik:

"All men are inexplicable, each in his own perversity, in his own mind, which is unparalleled and inimitable."

А. Naumkin, "Calagia."


ZZU OK, forget it. I've already found the answers I came for. And I know how to implement them in code. I'll take my leave.
Thanks again for your participation.

 

The chart accesses will be upgraded, it's our fault.

Also launched a full revision of all similar places.

 
MetaQuotes:

The chart accesses will be upgraded, it's our fault.

Also launched a full revision of all similar places.

Great!
Please note the fact that the execution time of Get methods depends on many different factors, e.g. bar width.
This seems like a strange thing to do.


Files:
 
MetaQuotes:

The chart accesses will be upgraded, it's our fault.

Also launched a full revision of all similar places.

Please pay attention to the most likely bug in the display of parentheses highlighting. In the latest version of the editor (2489) brackets are not highlighted in background as before - they now have a colour other than ASCII-characters, which is set in the editor settings:


This is very inconvenient - you can't see this highlighting in a large number of lines of code.

Настройки - Справка по MetaEditor
Настройки - Справка по MetaEditor
  • www.metatrader5.com
MetaEditor обладает множеством настроек, что позволяет организовать работу в среде разработки так, как это удобно именно вам. Чтобы открыть настройки, нажмите " Общие # — включить/выключить режим автоматического открытия прокручиваемого списка с именами встроенных и пользовательских функций при вводе первых символов их названия. Цвета # В блоке...
 

Maybe someone knows the answer to a simple question:

There is an array of the form ENUM_TIMEFRAMES tf[]={PERIOD_M1,PERIOD_M15,PERIOD_H1};

We need to get the first element from it and make a variable with it. This variable will contain for example PERIOD_M1.

To store this variable then in a weird construct which needs a period:

candle[PERIOD_M1] //square brackets are NOT an error

I keep getting errors all the time.

The candle construct from library CCheckNewCandle, checks for a new candle

I don't want to duplicate code for each timeframe

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

Bugs, bugs, questions

Alexey Topounov, 2020.06.10 12:14

Dear developers!

Please comment on this issue. What happened to the standard Moving Average ?

Moving Average on M1

Is it like this?


It's useless to ask. Been asking for attention from time to time for a year now.

https://www.mql5.com/ru/forum/1111/page2522#comment_12650337

https://www.mql5.com/ru/forum/1111/page2625#comment_14611834

It's not just Moving Average. All indicator buffers on the chart are going off.

The most interesting thing is who has the Expert Advisor on the minutes. The person will not understand why he is losing.

Ошибки, баги, вопросы
Ошибки, баги, вопросы
  • 2019.07.31
  • www.mql5.com
Общее обсуждение: Ошибки, баги, вопросы
 
Hello. As far as I can see changing thisCHART_CONTEXT_MENU constant for MT4 does nothing, but will it work in the future? That is, are there plans in principle to update the MT4 platform with corrections to what is not working?
 

MT5 (buidl 2494) regarding ChartGetXXXX/ChartSetXXXXXX execution speed
Updated code "steps to play":

long chart_id;

int OnInit(){
   for(int i = 0; i < 95; ++i){
      ChartOpen(_Symbol, _Period);
   }

   chart_id = ChartID();
   EventSetMillisecondTimer(250);
   return(INIT_SUCCEEDED);
}

void OnTimer(){
  ulong t=GetMicrosecondCount();
  ChartSetInteger(chart_id, CHART_AUTOSCROLL, rand() % 2);
  long autoscroll = ChartGetInteger(chart_id, CHART_AUTOSCROLL);
  
  if (autoscroll >= 0){
     ulong delay =(GetMicrosecondCount()-t)/1000;
     if (delay>0){
       Print("Execution delay: ",delay, " ms");
     }
  }
}


The same actions that cause chart hangs in both builds (2494 and 2009) show dramatically different ChartGetXXXXXX execution times:
Build 2494 - more than 1 sec.
Build 2009 - 10 ms.

I suspect that surprisingly good results of build 2009 are not related to the speed of executing ChartGetXXXXXX function but rather tospeculative execution of variable delay calculation by the processor.
It could be that the test for 2009 build is not valid...

 
Sergey Dzyublik:

MT5 (buidl 2494) regarding ChartGetXXXX/ChartSetXXXXXX execution speed
Updated code "steps to play":

Why is the autoscroll variable not used anywhere? The compiler could easily cut out this operation without any speculative executions