I made up a screenshot showing the Code used and the csv file output, then marked up / documented in an xls.
The code I used as this:
Code: Select all
FileWrite(handle,TimeToString(Time[i]),Open[i],High[i],Low[i],Close[i],iOpen(NULL,PERIOD_D1,iBarShift(NULL,PERIOD_D1,Time[i+1])),iHigh(NULL,PERIOD_D1,iBarShift(NULL,PERIOD_D1,Time[i+1])),iLow(NULL,PERIOD_D1,iBarShift(NULL,PERIOD_D1,Time[i+1])),iClose(NULL,PERIOD_D1,iBarShift(NULL,PERIOD_D1,Time[i+1])));
The green, yellow, orange and red highlights show all else is correct. The problem is hours 0100 ~ 23:00h and only affects the BarShift related cells.
I have shown the full 24h period plus last and first bar of the previous and subsequent days. The symmetry is always the same i.e. I have not "cherry picked" an untypical day.
Have I erred or am I trying to do something intrinsically not do-able?
TIA for any critique and/or corrections.