Lean
Lean copied to clipboard
FilteredIdentity doesn't accept Python lambda.
Expected Behavior
This algorithm runs without error
class FilteredIdentityAlgorithm(QCAlgorithm):
def initialize(self) -> None:
self._symbol = self.add_equity("SPY", Resolution.DAILY).symbol
self._filtered_identity = FilteredIdentity("SPY", filter = lambda x: x.Close > x.Open)
Actual Behavior
at initialize
self._filtered_identity = FilteredIdentity("SPY", filter = lambda x: x.Close > x.Open)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
in main.py: line 9
No method matches given arguments for .ctor: (<class 'str'>)
Potential Solution
N/A
Reproducing the Problem
Run algorithm above
System Information
QC Cloud
Checklist
- [x] I have completely filled out this template
- [x] I have confirmed that this issue exists on the current
masterbranch - [x] I have confirmed that this is not a duplicate issue by searching issues
- [x] I have provided detailed steps to reproduce the issue