100 bucks to the Wiz who can fix this for me ASAP !

 
Slight problem with linear interpolation of data, where X is not evenly spaced (missing bars).
 
DayTrader:
Slight problem with linear interpolation of data, where X is not evenly spaced (missing bars).

Maybe this can solve the problem of missing bars

https://www.mql5.com/en/articles/1407

 
DayTrader:
Slight problem with linear interpolation of data, where X is not evenly spaced (missing bars).

Use the "period-converter" script supplied with the platform to recreate the longer time-periods from a set of short time-period data which you know to be complete.


CB

 

Well, its not that kind of missing bars... This problem is slightly more complex.

This is for a indicator that works on higher TFs, lets say 1D, there is always a 1D bar, and this goes for 4H too. But at TF 1H and lower there are missing bars (hours) over the weekend.

On TF 1H there is never more than 1 bar missing, but this gets worse at lower TFs... At TF 30M there is 2 missing bars, and at TF 1M there is 60 missing bars.

My problem comes when I'm at say 1M and try to interpolate between the 1H bars... between some of the 1H bars there are something like 30 1M bars missing and this totally upsets the interpolation

algorithm which requires equally spaced time series data ( X values). The result is large spikes in the interpolated data.

I dunno exactly where the problem lays, it may be that I'm overlooking something very basic.

In any case what looks like evenly spaced HTF samples are not evenly spaced when examined from a lower TF.

Offer still stands !

 

Funny thing... writing the problem down and explaining it sort of cleared my mind and I got a glimpse of the bigger picture...

I think my interpolation has been correct all the time, and that instead the raw data has been flawed.

I sampled the HTF like this, by looking for times that matched the HTF:

      while(i < limit)//Store HTF data in array:
         {     
         int Bar_Shift=iBarShift(NULL,TimeFrame,Time[i],true);
         Buffer[i]=iMA(Currency,TimeFrame,MAPeriod,ma_shift,ma_method,applied_price,Bar_Shift) ; //Red line
         ExtMapBuffer2[i] = Buffer[i];
         i++;
         }  
This obviously causes a gap in data over weekends and other holidays.

I'll now do a simple bar count instead and I bet that will fix the problem.

 

Nope, wasn't as easy as I thought. I know exactly where / what the problem is, but not how to fix it.

After correcting the time series spacing problem (samples are now equally spaced) I gradually get out of sync with the data returned by iMA, and the data gets more and more distorted.

Offer still on.

Come on guys !

 

I don't know what you are trying to do, but...

Maybe calculate your "time" instead of relying on Time[i], and use iBarShift() (which you have done)

Reason: