Skip to content

Commit ed3c1ed

Browse files
committed
Add comments
1 parent 1917b8e commit ed3c1ed

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

Algorithm/QCAlgorithm.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3711,6 +3711,10 @@ private IEnumerable<KeyValuePair<Symbol, IEnumerable<T>>> GetChainsData<T>(IEnum
37113711
{
37123712
foreach (var symbol in canonicalSymbols)
37133713
{
3714+
// We will add a safety measure in case the universe file for the current time is not available:
3715+
// we will use the latest available universe file within the last 3 trading dates.
3716+
// This is useful in cases like live trading when the algorithm is deployed at a time of day when
3717+
// the universe file is not available yet.
37143718
var history = (DataDictionary<T>)null;
37153719
var periods = 1;
37163720
while ((history == null || history.Count == 0) && periods <= 3)

Engine/DataFeeds/BacktestingChainProvider.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ protected IEnumerable<Symbol> GetSymbols(Symbol canonicalSymbol, DateTime date)
7070
// Use this GetEntry extension method since it's data type dependent, so we get the correct entry for the option universe
7171
var marketHoursEntry = marketHoursDataBase.GetEntry(canonicalSymbol, new[] { universeType });
7272

73+
// We will add a safety measure in case the universe file for the current time is not available:
74+
// we will use the latest available universe file within the last 3 trading dates.
75+
// This is useful in cases like live trading when the algorithm is deployed at a time of day when
76+
// the universe file is not available yet.
7377
var history = (List<Slice>)null;
7478
var periods = 1;
7579
while ((history == null || history.Count == 0) && periods <= 3)

0 commit comments

Comments
 (0)