missing candle on metatrader
int nBarsPerDayMax = PERIOD_D1 / Period();Remember that if there are no ticks during a candle period, there is no candle.
I think you have to do something like.......
You have to use starttime of date
That will be
datetime daystart = iTime(Symbol(),PERIOD_D1,0);
On the timeframe you are you have to find the barshift of this time
that will be
candels = iBarShift(Symbol(),0,daystart,false);
Yôu have had one more candle this day
Periods that have been past is
double periods.this.day = (TimeCurrent()- daystart)/(60*Period());
make this value a whole number rounding above
emm, honestly guys i'm not much of a programmer in this life, if it is not too much trouble can it be translated into indicator Thanks please reply .
Hello is there an indicator to count 1 day total candle that already formed example 1 hour = 24 candle, 30 minutes = 48 candle etc . Because all indicator are based on price missing candle are crucial especially on lower time frame such as 1 minutes, 5 minutes . I noticed that missing candle happen time to time especially on lower timeframe . I've delete the history to rewrite the graphic but sometimes it is still missing .
thanks please reply