Why are the indicators (lines, arrows, histograms) flickering in the MT5 terminal? - page 2
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Try printing prev_calculated at the very beginning of OnCalculate.
And compare with some standard indicator - whether it flashes.
static int last_rates_total=0; // previous value "input timeseries size at previous
static int last_prev_calculated=0; // previous value "bars processed at the previous call
and verification code with the output to the journal
Started the AOM indicator on the minute and got this report
Nothing unexpected, normal processing of only new bars coming in is going on.
Added two static variables to OnCalculate() function to compare current values with previous values:
Nothing unexpected, there is a normal process of handling only new bars coming in.
No, I put a couple of standard indicators "Moving Average", "Awesome Oscillator" on the chart. Observed. No, I did not notice any flickering or disappearing values in"Data Window".
No, I put a couple of standard indicators "Moving Average", "Awesome Oscillator" on the chart. Observed. No, I did not notice any flickering or disappearance of values in"Data Window".
I mean those indicators that are in the source (mq5).
If they do not blink, then the problem is obviously in your code. Simplify it until it stops flickering. Or vice versa - refine the standard code to your state, until it flickers.
So you have to accept it, take it for granted and stop looking for the cause?
By the way, I haven't found a universal "wrapper" for OnCalculate() function, even among standard indicators, to use it once and for all.
Maybe, you know some indicator that has such a "wrapper" to use it as a reference?
So you have to accept it, take it for granted and stop looking for a reason?
But I've already simplified the code to the extreme. Ok, I'll try to go in other way.
It may be about any little thing.
By the way, I have not yet found a universal "wrapper" for the OnCalculate() function, even among the standard indicators, to use it once and for all.
Maybe, you may suggest an indicator which has such a "wrapper" to use it as a reference?
I have seen several variants. You may search and choose.
I use this one myself: