I have a 3k volume chart on the ES and add a Day period DataSeries to it.
I then add this code to OnBarUpdate:
if (State == State.Historical){ if (Bars.IsFirstBarOfSession && BarsInProgress == 0){ Print("BarsInProgress 0 date is: " + ToDay(Time[0]) + " With an Open[0] of: " + Open[0]); } if (BarsInProgress == 1){ Print("BarsInProgress 1 date is: " + ToDay(Time[0]) + " With an Open[0] of: " + Open[0]); } }
AND! They don't match up with the Open on that separate daily chart .
Look at the attached picture and compare the Open on 8/17/2017, which is 2466.75 in the DataBox, to what the Output prints:
BarsInProgress 1 date is: 20170817 With an Open[0] of: 2466.75
BarsInProgress 0 date is: 20170817 With an Open[0] of: 2426.75
Both charts are set to use instrument settings for the trading hours / session and the Instrument is set to CME US Index Futures ETH.
Can you please explain why the above happens?
Are the daily bars not using the same session info as the other data series?
EDIT:
I went ahead and changed the session to regular trading hours (RTH) and the data still doesn't match as shown from this output:
BarsInProgress 0 date is: 20170817 With an Open[0] of: 2460.5
BarsInProgress 1 date is: 20170817 With an Open[0] of: 2466.75
BarsInProgress 0 date is: 20170818 With an Open[0] of: 2426.5
BarsInProgress 1 date is: 20170818 With an Open[0] of: 2426.75
BarsInProgress 0 date is: 20170821 With an Open[0] of: 2424.25
BarsInProgress 1 date is: 20170821 With an Open[0] of: 2428.75
BarsInProgress 0 date is: 20170822 With an Open[0] of: 2433.25
BarsInProgress 1 date is: 20170822 With an Open[0] of: 2428
BarsInProgress 0 date is: 20170823 With an Open[0] of: 2440.5
BarsInProgress 1 date is: 20170823 With an Open[0] of: 2453
I'm trying to use the daily bars as the main generator of data regarding the daily open, high, low, close but I'm getting inconsistent results when trying to reconcile that data with the data from other volume-based data series.
Shouldn't the first bar's open match the daily bar's open always? At least have the same date?
Comment