{"library":"quantconnect-stubs","title":"QuantConnect Stubs (Lean)","description":"Type stubs for QuantConnect's Lean algorithmic trading engine, enabling type hints and static analysis in Python. Current version 17685 (based on a build number; no standard semver). Released frequently as Lean evolves.","language":"python","status":"active","last_verified":"Mon Apr 27","install":{"commands":["pip install quantconnect-stubs"],"cli":null},"imports":["from Algorithm import QCAlgorithm","from QuantConnect.Orders import OrderType","from QuantConnect import Symbol"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from Algorithm import QCAlgorithm\n\nclass MyAlgorithm(QCAlgorithm):\n    def Initialize(self):\n        self.SetStartDate(2020, 1, 1)\n        self.SetEndDate(2020, 12, 31)\n        self.SetCash(100000)\n        self.AddEquity(\"SPY\", Resolution.Minute)\n\n    def OnData(self, data):\n        if not self.Portfolio.Invested:\n            self.SetHoldings(\"SPY\", 1.0)","lang":"python","description":"Basic QuantConnect algorithm using stubs for type hints.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}