Explicitly set the required empty value for each indicator buffer using PLOT_EMPTY_VALUE.
There is a mention of this in the DRAW_CANDLES documentation. Even though you don't need DRAW_CANDLES, what was said there about the empty value still holds true.
The indicator is drawn only to those bars, for which non-empty values of all four indicator buffers are set. (This is for DRAW_CANDLES)
The indicator is drawn only for those bars for which non-empty indicator buffer values are specified.
To specify what value should be considered as "empty", set this value in the PLOT_EMPTY_VALUE property:
//--- The 0 (empty) value will mot participate in drawing PlotIndexSetDouble(index_of_plot_DRAW_CANDLES,PLOT_EMPTY_VALUE,0);
Always explicitly fill in the values of the indicator buffers, set an empty value in a buffer to skip bars.
That is, if arrows are displayed, then the buffer contains values other than empty.
If you do not explicitly specify an empty value for the buffer, then the empty value for the buffer will depend on the terminal defaults.
Your arrow buffers contain zeros. Most likely, the terminal by default considers EMPTY_VALUE to be an empty value for this buffer, and not 0
Explicitly set the required empty value for each indicator buffer using PLOT_EMPTY_VALUE.
There is a mention of this in the DRAW_CANDLES documentation. Even though you don't need DRAW_CANDLES, what was said there about the empty value still holds true.
That is, if arrows are displayed, then the buffer contains values other than empty.
If you do not explicitly specify an empty value for the buffer, then the empty value for the buffer will depend on the terminal defaults.I have
I have tried this brother but still it is showing so many arrows. Please help. Thankyou !

- www.mql5.com
if you're trying to make one arrow appear on the states of line color change, then you should modify this part of the code:
for(i = j - Periods; i >= 0; i--) { b2[i] = EMPTY_VALUE; b3[i] = EMPTY_VALUE; lda_20[i] = lda_20[i + 1]; if(noPlotBuffer[i] > noPlotBuffer[i + 1]) lda_20[i] = 1; if(noPlotBuffer[i] < noPlotBuffer[i + 1]) lda_20[i] = -1; if(lda_20[i] > 0.0) { aquaLineBuffer[i] = noPlotBuffer[i]; if(lda_20[i + 1] < 0.0) aquaLineBuffer[i + 1] = noPlotBuffer[i + 1]; redLineBuffer[i] = EMPTY_VALUE; if (Previous_Signal != "Buy") { b3[i] = low[i]; Previous_Signal = "Buy"; Print(Previous_Signal, " ", i); } } else { if(lda_20[i] < 0.0) { redLineBuffer[i] = noPlotBuffer[i]; if(lda_20[i + 1] > 0.0) redLineBuffer[i + 1] = noPlotBuffer[i + 1]; aquaLineBuffer[i] = EMPTY_VALUE; if (Previous_Signal != "Sell") { b2[i] = high[i]; Previous_Signal = "Sell"; // Print(Previous_Signal," ", i); } } } }
and take away the arrow buffer code from there:
for(int i=TotalBars-2 && !IsStopped() ; i>=1; i--) { if(aquaLineBuffer[i+1]!=EMPTY_VALUE && redLineBuffer[i+1]!=EMPTY_VALUE && aquaLineBuffer[i]!=EMPTY_VALUE && redLineBuffer[i]==EMPTY_VALUE&& Previous_Signal!="Buy") { // b3[i] = low[i]-Arrow_PointGap*Point(); //REMOVE Previous_Signal="Buy"; Print(Previous_Signal," ", i); } //Print(i+2," bufer Size : ",ArraySize(aquaLineBuffer)); if(aquaLineBuffer[i+2]!=EMPTY_VALUE && aquaLineBuffer[i+1]!=EMPTY_VALUE && redLineBuffer[i+1]!=EMPTY_VALUE && redLineBuffer[i]!=EMPTY_VALUE && Previous_Signal!="Sell") { // b2[i] = high[i]+Arrow_PointGap*Point(); //REMOVE Previous_Signal="Sell"; // Print(Previous_Signal," ", i); } }
All the other initialization code is fine
I have tried PLOT_EMPTY_VALUE but still it is ploting so many false arrows, please run it on Daily chart timeframe. Thanks!
Zeros for arrows in the data window are no longer displayed. This means that the arrows now contain empty values. (Compare this to the previous screenshot where you could see zeros in the data window)
Now the empty values for the arrows seem to be ok. As for the extra arrows, now this is only caused by a logical error in your code. I haven't studied the logic of your code.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi Everyone!
The indicator is showing arrows, but i have commented the ( buffer[i]=value; ) line.
i dont know what is setting the values of buffer and why arrows are showing on the chart.
Thanks!
REX (Hassan Bilal)