20 using System.Collections.Generic;
49 _algorithm = algorithm;
65 Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)
67 market ??= _algorithm.BrokerageModel.DefaultMarkets.TryGetValue(
SecurityType.Equity, out var defaultMarket)
69 :
throw new Exception(
"No default market set for security type: Equity");
71 var etfSymbol =
new Symbol(
76 mappingResolveDate: _algorithm.Time.Date),
79 return ETF(etfSymbol, universeSettings, universeFilterFunc);
89 public Universe ETF(
string etfTicker,
string market, Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)
91 return ETF(etfTicker, market,
null, universeFilterFunc);
100 public Universe ETF(
string etfTicker, Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)
102 return ETF(etfTicker,
null,
null, universeFilterFunc);
115 Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)
117 return ETF(etfTicker,
null, universeSettings, universeFilterFunc);
130 string market =
null,
132 PyObject universeFilterFunc =
null)
134 return ETF(etfTicker, market, universeSettings, universeFilterFunc?.ConvertPythonUniverseFilterFunction<ETFConstituentUniverse>());
147 PyObject universeFilterFunc)
149 return ETF(etfTicker,
null, universeSettings, universeFilterFunc);
160 Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)
171 public Universe ETF(
Symbol symbol, Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)
173 return ETF(symbol,
null, universeFilterFunc);
185 return ETF(symbol, universeSettings ?? _algorithm.UniverseSettings,
198 Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)
200 market ??= _algorithm.BrokerageModel.DefaultMarkets.TryGetValue(
SecurityType.Index, out var defaultMarket)
202 :
throw new Exception(
"No default market set for security type: Index");
217 public Universe Index(
string indexTicker,
string market, Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)
219 return Index(indexTicker, market,
null, universeFilterFunc);
228 public Universe Index(
string indexTicker, Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)
230 return Index(indexTicker,
null,
null, universeFilterFunc);
241 Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)
243 return Index(indexTicker,
null, universeSettings, universeFilterFunc);
256 string market =
null,
258 PyObject universeFilterFunc =
null)
260 return Index(indexTicker, market, universeSettings, universeFilterFunc?.ConvertPythonUniverseFilterFunction<ETFConstituentUniverse>());
273 PyObject universeFilterFunc)
275 return Index(indexTicker,
null, universeSettings, universeFilterFunc);
286 Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)
297 public Universe Index(
Symbol indexSymbol, Func<IEnumerable<ETFConstituentUniverse>, IEnumerable<Symbol>> universeFilterFunc)
299 return Index(indexSymbol,
null, universeFilterFunc);
312 PyObject universeFilterFunc =
null)
314 return Index(indexSymbol, universeSettings ?? _algorithm.UniverseSettings,
346 from c in selectionData
347 orderby c.DollarVolume descending
348 select c.Symbol).Take(count),