Lean icon indicating copy to clipboard operation
Lean copied to clipboard

BrokerageModelPythonWrapper Does Not Accept DefaultMarkets as Python Dictionary

Open AlexCatarino opened this issue 3 years ago • 0 comments

Expected Behavior

Be able to set the DefaultMarkets in a Custom Brokerage Model in Python using Python dictionaries.

Actual Behavior

The requires type is IReadOnlyDictionary<SecurityType, string>.

Potential Solution

N/A

Reproducing the Problem

class BasicTemplateFrameworkAlgorithm(QCAlgorithm):
    def Initialize(self):
        self.SetStartDate(2013,10,7)
        self.SetEndDate(2013,10,11)
        self.SetBrokerageModel(MyBrokerageModel())
        self.AddEquity("SPY")

class MyBrokerageModel(DefaultBrokerageModel):
    DefaultMarkets = { SecurityType.Equity: Market.USA }

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

AlexCatarino avatar Jun 02 '22 21:06 AlexCatarino