Open jaredbroad opened 5 years ago
These two issues might be related:
Has this issue been addressed? At least from the first Python tutorial https://www.quantconnect.com/tutorials/api-tutorials/consolidating-data-to-build-bars there is a line thirtyMinuteConsolidator.DataConsolidated += self.ThirtyMinuteBarHandler
that indicates support for addition operator on events/handlers?
But I guess events are different from indicators, and only inequality operators are implemented e.g. GreaterThan https://github.com/QuantConnect/Lean/blob/03efc1b735bb8b841eb04434f537ac3d798f5877/Tests/Indicators/IndicatorTests.cs#L227
Not sure if this is related as well https://github.com/QuantConnect/Lean/blob/d1624ab8998deea2afd54a7db6b3694886665f14/Common/Python/PandasData.cs#L265
Sorry I just realized that the event += handler
pattern is not exactly an operator, I'm not familiar with C#. It's surprising that the same syntax works in Python, seems like it's out of the box since it's used in the pythonnet demo for windows forms applications too
Edit: I see now that this is done by overloading nb_inplace_add
etc. in eventbinding.cs via eventobject.cs
Expected Behavior
All operators work in comparing indicators.
+
,-
,*
,/
.Actual Behavior
Only
<
and>
work. The other operators require referencingCurrent.Value
Potential Solution
Explore and understand why < > work and apply lessons to other operators.
Reproducing the Problem
This shouldn't work but it does.
Checklist
master
branch