I've been testing and debugging the strategy with two time frames 5 min and daily. See the code below. I found out that when I add daily time frame to the main 5 min one the OnBarUpdate() is never called (for neither time frame 5 min nor daily) till the session end (17:15 for futures). Note, the code in OnBarUpdate() doesn't matter as the method is not called. I made sure there is enough historical data. Now, when I disable the second, daily time frame - problem disappears. Why?
protected override void Initialize()
{
this.Days2Load = 16;
this.BarsRequired = 8;
Add(PeriodType.Day, 1);
}
/// <summary>
/// Called on each bar update event (incoming tick).
/// </summary>
protected override void OnBarUpdate()
{
if (this.CurrentBars[0] < 40
|| this.CurrentBars[1] < 8)
return; //Check if enough bars for indicators
//...
}
Comment