The currency data is working fine as is the vix data.
The Stock and Index date timestamp is -1 day from the OHLC and a check with the historical data manager confirms this.
Some the the futures data works and some have the date behind the price data.
I put this code is as it seems to run through on each barupdate twice on the primary bar and once on all the others, eg. 0,1,2,3,0.
So this code works on the second appearance of the primary bar.
I can see why on a daily feed the dates and prices would miss on some and work on others
if (lastinstrument==true && BarsInProgress == 0)
lastinstrument=false;
if (BarsInProgress == 0)lastinstrument=true;
protected override void OnBarUpdate() { // Use this method for calculating your indicator values. Assign a value to each // plot below by replacing 'Close[0]' with your own formula. if (excelOpen == false) { SetUpSpreadsheet(); rowCount ++; } if (lastinstrument==true && BarsInProgress == 0) { for (int i = 0; i < 437; i++) { if (CurrentBars[i]>=0) { excelSheet = (Excel._Worksheet)excelWorkBook.Sheets[names[i]]; excelSheet.Cells[rowCount,1] = ToDay(Times[i][0]); excelSheet.Cells[rowCount,2] = ToTime(Times[i][0]); excelSheet.Cells[rowCount,3] = Opens[i][0]; excelSheet.Cells[rowCount,4] = Highs[i][0]; excelSheet.Cells[rowCount,5] = Lows[i][0]; excelSheet.Cells[rowCount,6] = Closes[i][0]; excelSheet.Cells[rowCount,7] = Volumes[i][0]; } } lastinstrument=false; rowCount ++; if (rowCount == Count+10) rowCount = 1; } if (BarsInProgress == 0)lastinstrument=true; }
Comment