Why are the indicators (lines, arrows, histograms) flickering in the MT5 terminal? - page 7

 
I don't know if it will help, but I solved this problem this way: in the code where the loop like for(int i=rates_total-prev_calculate; i>=0;i--) replaced rates_total-prev_calculate with a numeric value of 1500 and flicker stopped!
 
Dmitry Melnichenko: I don't know if it helps, but I solved this problem this way: I replaced rates_total-prev_calculate by numerical value 1500 in the code where loop is like for (int i=rates_total-prev_calculate; i>=0;i--) and flickering stopped!

Strange, by doing that you just limited number of bars to be processed in the loop by 1500, i.e. you notice that if you sharply limit the number of bars (by an order of magnitude, or even by 2 orders of magnitude) to be processed, then the flicker disappears. Perhaps there is something in it, I will have to check it.

Then the OnCalculate() function from the first example in this thread would look like this:

//+------------------------------------------------------------------+
//| Custom indicator iteration function
//+------------------------------------------------------------------+
int OnCalculate (const int rates_total,      // размер входных таймсерий 
                 const int prev_calculated,  // обработано баров на предыдущем вызове 
                 const datetime& time[],     // Time 
                 const double&   open[],     // Open 
                 const double&   high[],     // High 
                 const double&   low [],     // Low 
                 const double&   close[],    // Close 
                 const long& tick_volume[],  // Tick Volume 
                 const long& real_volume[],  // Real Volume 
                 const int&  spread[])       // Spread 
{
// int N=rates_total-prev_calculated; if (N>MAX_PERIOD) N-=MAX_PERIOD;

   for (int i=1500; i>0 && !IsStopped(); i--) {
      double ma_fast=getMA(ma_fast_handle, i);
      double ma_slow=getMA(ma_slow_handle, i);;
      aom=ma_fast-ma_slow;
      if (aom>last_aom) {aUP[i]=aom; aDN[i]=EMPTY_VALUE;}
      else              {aDN[i]=aom; aUP[i]=EMPTY_VALUE;}
      last_aom=aom;
   }
   aUP[0]=EMPTY_VALUE; aDN[0]=EMPTY_VALUE;
   return(rates_total);
}

But it doesn't solve the problem as a whole, if we need to display the indicator on the whole set of bars.

 

Apparently the terminal does not send the broker a confirmation that the quote history has changed. ( maybe the antivirus is resisting).

But the broker (broker's server) sends and sends, "we need to change the quotes history".

Or your computer is too weak for MT5 to have time to change the quotes history before the broker sends the new quotes.

 
Sergey Chalyshev:

Apparently the terminal does not send the broker a confirmation that the quote history has changed. ( maybe the antivirus is resisting).

But the broker (broker's server) sends and sends, "you need to change the quotes history".

Or your computer is too weak to change the quote history before the broker sends the new quote history.

ZZ flickers on weekends as well.
 
-Aleks-:

ZZ flickers on weekends as well.

It depends on the broker and its server settings. The MQL demo server, for example, rewrites the history after 3 hours.

Maybe I'm wrong, hopefully the platform developers will come along and explain.


 
Sergey Chalyshev:

It depends on the broker and its server settings. The MQL demo server, for example, rewrites the history after 3 hours.

Maybe I'm wrong, hopefully the platform developers will come along and explain.

I have a broker called "Otkritie" - not a demo account.

The developers are silent as partisans.

 
-Aleks-:

I have a broker called Otkritie - not a demo account.

The developers are silent as a partisan.


ChartRedraw

Causes the specified chart to be forcibly redrawn.

Is it in the code?

 
Sergey Chalyshev:

ChartRedraw

Causes the specified chart to be forcefully redrawn.

Is there one in the code?

No.
 
-Aleks-:

No.

Is this particular indicator glitchy? I'll look into it at my leisure.

 
Sergey Chalyshev:

Is this particular indicator glitchy? I'll look into it at my leisure.

I'm talking about the standard ZigZag indicator from MT5.
Reason: