New MetaTrader 4 Client Terminal 387 and MetaTrader 4 Data Center build 387 - page 3

 
AlexSTAL:

What exactly is your problem? It's the same as it was and still is... no recalculation on every tick....


I have the same as Junko - all indicators have optimization. And the whole buffer is not recalculated on every tick. If there will be forced reinitialization at every tick, they will have to rewrite all indicators. Isn't it a problem? Repeatedly voiced, by the way.

And I'm not worried about myself. As it happens, a huge number of people use these indicators. But they are going to have real problems.

Here, for example, http://ruforum.mt5.com/showthread.php?t=374.

There are plenty of links to choose from.

 
AlexSTAL:

I read his explanation....

Have you tested it yourself in practice?

What exactly is your problem? It's the same as it was, and still is... no recalculation on every tick....

My indicator buffer filling was by change condition. If there is a change, fill it, if there isn't, don't fill it. It didn't work on 387.

I removed the condition and it worked. When it didn't work, I saw that the buffer was filled with default values (initialized).

Maybe you didn't look at it that way? Didn't notice or it's not critical for your indicator?

You should wait for explanations from Metaquotes.

 

This is part of the indicator:

// Если произошёл первый пуск индикатора или предыдущим блоком разрешена развёртка или изменились параметры окна.
if (gl_nCounterTeak == 1 || st_bRecalculation == true || st_nWBarsPerChart != tmp_nBarsPerChart || st_nWFirstVisiblBar != tmp_nFirstVisiblBar)
 {// Закрепляем значок вызова свойств индикатора.
  st_nWBeginSearch = st_nWFirstVisiblBar - st_nWBarsPerChart;
  if (st_nWBeginSearch < -1) // Если справа есть свободное пространство, закрепляем значок вызова свойств индикатора.
   {
    GetClientRect(gl_hWindow, st_aiRect); // Расчёт размеров окна.
    gl_adBufIndicator2[0] = 0.35 * (gl_dMaxPositionMark - gl_dMinPositionMark) + gl_dMinPositionMark;
    SetIndexShift(1, - st_nWBeginSearch - 0.5 * ((36 * st_nWBarsPerChart) / st_aiRect[2] - 1));
    SetIndexDrawBegin(1, 0);
   }
  // Устанавливаем развёртку.
  if (st_nWBeginSearch <= 0) st_nWBeginSearch = 0;
  for (i = st_nWFirstVisiblBar; i >= st_nWBeginSearch; i--)
   {// Очищаем буфер от лишних значков для вызова окна свойств индикатора.
    if (i > 0) gl_adBufIndicator2[i] = EMPTY_VALUE;
    // Закрепление вертикальной развёртки графика с помощью индикаторного буфера.
    if (i % 2 == 0) gl_adBufIndicator1[i] = gl_dMaxPositionMark; // Для фиксации верхней координаты дополнительного окна.
    else gl_adBufIndicator1[i] = gl_dMinPositionMark;            // Для фиксации нижней координаты дополнительного окна.
   }
  // Расчёт и создание горизонтальных линий разметки. Создаём один раз и отслеживаем через заданный уровень при увеличениях максимальных уровней.
  // Установка вертикальной развёртки, расчёт и создание горизонтальных линий разметки.
  if ((gl_dMaxPositionMark - gl_dMinPositionMark) != tmp_dDifferPosMark)
   {
    MakingHorizontalSectoring(AutoStep, Color_LNH, Color_LN0, gl_dMaxPositionMark, gl_dMinPositionMark, Step_LNH, 15, Style_LNH, Width_LNH, st_nWindow, gl_sFullNameObject);
   }
 }
 
nen:

If you haven't deleted correspondence from private message, look, there I gave examples of optimization. You wrote then, that it is clear to you.

I deleted the correspondence, but I understand perfectly well what optimisation is without it...

Clearly state with a minimum of code what you are afraid of, but have not reproduced in reality...

This is a completely inane conversation... None of my indicators ask me to reinitialize buffers on every tick...

That's why I'm trying to understand what we're talking about....


to Zhunko: I will try to understand it later

 

Here's changed a couple of lines in the test indicator (which I posted to find the error)...

No buffers are recalculated on any ticks at all!

Nothing has changed at all

Files:
 
AlexSTAL:

Here's changed a couple of lines in the test indicator (which I posted to find the error)...

No buffers are recalculated on any ticks at all!

Nothing has changed at all

Looked at the code. There are no ticks. That's why it doesn't change. The ticks are needed from the chart update.
 
Zhunko:
Looked at the code. There are no ticks. That's why it doesn't change. You need a tick from a chart update.
What is a "tick from chart refresh"? Artificially triggered or what? By an API?
 

Here's the one with the last tick message:

No buffers are updated

The number 2147483647 is the buffer value on the new bar.

 
AlexSTAL:
What is a "tick from chart update"? Is it artificially triggered or what? by an API?

Yes. This is the only difference in our conditions.

It is better to refresh not in an indicator, but in a looped script.

 
Zhunko:

Yes. That's the only difference in our conditions.

Figured it out on page 6...

Now very interesting, where does nen cause the artificial tic?

Reason: