Marbo: There are always some dots somewhere in the chart and I don't know how to delete them.
PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,0);
At the top of your loop, set both buffer elements to zero.
Marbo :
Hey guys,
I made this indicator showing me candles where the body size is <0.5 x candle size. These candles are indicated by a dot in the middle of the body.
My problem occurs when I am changing the timeframe. There are always some dots somewhere in the chart and I don't know how to delete them. I have to switch timeframes 3-4 times and then they disappear.
Can someone help me please?
You should always ZERO the indicator buffer:
int limit=prev_calculated-1; if(prev_calculated==0) limit=0; bullCandleBuffer[i]=0.0; bearCandleBuffer[i]=0.0; for(int i=limit; i<rates_total; i++) { double bodySize=MathAbs(close[i]-open[i]); double candleSize=high[i]-low[i]; if(bodySize<0.5*candleSize) { if(close[i]>open[i]) bullCandleBuffer[i]=MathAbs(close[i]+open[i])/2; else if(close[i]<open[i]) bearCandleBuffer[i]=MathAbs(close[i]+open[i])/2; } }
I included this into the loop and now it works perfect. Thank you!
for (int i=limit;i<rates_total;i++) { bullCandleBuffer[i]=0.0; bearCandleBuffer[i]=0.0; double bodySize=MathAbs(close[i]-open[i]); double candleSize=high[i]-low[i]; if (bodySize<0.5*candleSize) { if (close[i]>open[i]) bullCandleBuffer[i]=MathAbs(close[i]+open[i])/2; else if (close[i]<open[i]) bearCandleBuffer[i]=MathAbs(close[i]+open[i])/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
Hey guys,
I made this indicator showing me candles where the body size is <0.5 x candle size. These candles are indicated by a dot in the middle of the body.
My problem occurs when I am changing the timeframe. There are always some dots somewhere in the chart and I don't know how to delete them. I have to switch timeframes 3-4 times and then they disappear.
Can someone help me please?