when accessing daily bars, which when accessing the time with the Time series such as Time[n], the bar stamp is the end of the main session, e.g. 5PM New York for the ES.
However, when using Bars.GetTime(idx), it only returnsthe date, and the timestamp is midnight.
I had the daily bars loaded as a 2nd DataSeries inside an indicator.
**
In addition, within OnRender(), the Time DataSeries is screwy. Times[1][0] reports the first bar time, despite the CurrentBars[1] being a high number, e.g. 200.
**
Also, the Times are reporting incorrectly.
Time[1] is larger than Time[0]. This is in OnBarUpdate() on a 2nd DataSeries of day bars.
index 0 is 8/09/2016 5:00:00 PM matches bar 1187 8/09/2016 5:00:00 PM
index 1 is 9/09/2016 5:00:00 PM matches bar 1192 8/09/2016 8:30:00 PM
index 2 is 7/09/2016 5:00:00 PM matches bar 1141 7/09/2016 5:00:00 PM
index 3 is 6/09/2016 5:00:00 PM matches bar 1095 6/09/2016 5:00:00 PM
Here is the code that produced that result. pivotTimes and pivotIndexes are List objects.
pivotTimes.Clear(); pivotIndexes.Clear(); for (int x = 0; x<=CurrentBar; x++) { pivotTimes.Add(Time[x]); pivotIndexes.Add(BarsArray[0].GetBar(Time[x])); if (pivotIndexes[pivotIndexes.Count-1] > 0) Print("index "+x+" is "+Time[x]+" matches bar "+pivotIndexes[pivotIndexes.Count-1]+" "+Times[0][CurrentBars[0]-pivotIndexes[pivotIndexes.Count-1]]); }
Comment