Lean icon indicating copy to clipboard operation
Lean copied to clipboard

Can't omit an ETF constituents filter function

Open DerekMelchin opened this issue 3 years ago • 0 comments

Expected Behavior

If we don't provide a universeFilterFunc to the Universe.ETF method, the universe selects all of the ETF constituents.

Actual Behavior

If we don't provide a universeFilterFunc to the Universe.ETF method, we get the following error:

In Python

Runtime Error: Object reference not set to an instance of an object. in Extensions.cs:line 2685

In C#

Build Error File: project/Main.cs Line:57 Column:33 - The call is ambiguous between the following methods or properties: 'UniverseDefinitions.ETF(string, string, UniverseSettings, Func, IEnumerable>)' and 'UniverseDefinitions.ETF(string, string, UniverseSettings, PyObject)'

Potential Solution

N/A

Reproducing the Problem

Python

self.AddUniverse(self.Universe.ETF("SPY", Market.USA, self.UniverseSettings))

C#

AddUniverse(Universe.ETF("SPY", Market.USA, UniverseSettings));

System Information

QC Cloud

Checklist

  • [x] I have completely filled out this template
  • [x] I have confirmed that this issue exists on the current master branch
  • [x] I have confirmed that this is not a duplicate issue by searching issues
  • [x] I have provided detailed steps to reproduce the issue

DerekMelchin avatar Jun 08 '22 22:06 DerekMelchin