Add( PeriodType.Day, 1);
I'm trying to incorporate a secondary data series of daily bars into my strategy running in a 5 minute chart. I can add the series and run an indicator study on that daily bar series. I have some questions and problems.
Btw, this is all using the ES with Zen-Fire. I have the session template for the 5 minute primary series on the chart set to default 24-7.
I setup a single chart with the 5 minute ES and inserted a strategy that adds a daily bars in the Initialize() method:
Add(PeriodType.Day, 1 );
In the OnBarUpdate() I call an indicator on these daily bars by passing the bars array for it:
MyIndicator( BarsArray[1], .... )
I output some diagnostics to the output window that allow me to figure out if this indicator is performing the same way it does when it's simply inserted into a chart iwth just the daily bars on it. I noticed that my indicator study on this secondary series does not at all match up with the same indicator run on a separate chart in which the daily bars are the primary series.
To help myself understand what's going on I decided to create a chart with both a 5 minute and a daily set of bars. The daily bars in this multiple time frame chart are not the same as the daily bars if only the daily bars are in the chart. The difference seems to be that the daily bars in this multiple time frame chart are capturing a 24 day that begins and ends at midnight ( a calendar day ). They of course need to be associated with the trading session.
I attached a couple of screen shots of the charts with 2 symbols that show the daily bars together with the 5 minute bars. I used two different sessions trying to get the daily bars to be correct.
Ultimately I just want to be able to process daily bars from a strategy that is running in a smaller time frame like the 5 minute. How can I get accurate daily bars?
Thanks for staying with me through this explanation!
Comment