Please help me out this issue.when I have 10 days data for both instrument OnBarUpdate method is call properly. But when I have only primary instrument 10 days data and not have 10 days data for second instrument . OnBarUpdate method is not call at that time. I set DaysToLoad = 5 or 10 but its behavior is same. I only perform my calculation on primary instrument when running on historical data. Second instrument only use when we are running strategy for live not any calculation is done on historical data so why i need historical data for this second instrument?
Here is a script which i used to simple test on this situation
protected override void Initialize()
{
Add(PeriodType.Minute, 1);
Add(PeriodType.Minute, 10);
Add("$EURUSD", PeriodType.Minute, 1);
EntriesPerDirection = 1;
EntryHandling = EntryHandling.AllEntries;
SyncAccountPosition = false;
ExitOnClose = false;
Unmanaged = true;
Enabled = true;
CalculateOnBarClose = false;
}
protected override void OnBarUpdate()
{
if(BarsInProgress == 0)
{
Log( "Running on historical data",LogLevel.Information);
}
}
This string print in a log "Running on historical data" if I have both instrument historical data and if I have only primary instrument historical data this string is not printed in a log.

Comment