Lean icon indicating copy to clipboard operation
Lean copied to clipboard

Overloaded AddData Method Broken

Open D1mi3 opened this issue 1 year ago • 1 comments

Expected Behavior

The following overloaded method should add the passed data without any errors:

(method) def AddData(
    type: Type,
    ticker: str,
    properties: SymbolProperties,
    exchangeHours: SecurityExchangeHours,
    resolution: Resolution | None = None,
    fillForward: bool = False,
    leverage: float = 1
) -> Security

Actual Behavior

Since LEAN Engine v2.5.0.0.16356 the overloaded method generates the following error in algorithm initialization:

During the algorithm initialization, the following exception has occurred: Cannot perform runtime binding on a null reference in PythonData.cs:line 103 Cannot perform runtime binding on a null reference

Reproducing the Problem

Use the overloaded method to add any kind of custom data. e.g. self.custom_data = self.AddData(CustomData, "CUSTOM", SymbolProperties("placeholder", "USD", 1., 1., 1., "placeholder"), SecurityExchangeHours.AlwaysOpen(TimeZones.Utc), leverage=100.).Symbol

System Information

Quantconnect cloud with LEAN Engine v2.5.0.0.16423.

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

D1mi3 avatar May 09 '24 19:05 D1mi3

Hey @D1mi3! Thank you for the report, we will look into it 👍

Martin-Molinero avatar May 09 '24 21:05 Martin-Molinero