Registry / type-stubs / quantconnect-stubs

quantconnect-stubs

JSON →
library17685pypypiunverified

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.

pip install quantconnect-stubs
INSTALL
IMPORT
SIG · QUANTCONNECT-STUBS
Q
quantconnect-stubs
type-stubspythonv17685
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

QCAlgorithm
from QuantConnect import QCAlgorithm
from Algorithm import QCAlgorithm

Basic QuantConnect algorithm using stubs for type hints.

from Algorithm import QCAlgorithm class MyAlgorithm(QCAlgorithm): def Initialize(self): self.SetStartDate(2020, 1, 1) self.SetEndDate(2020, 12, 31) self.SetCash(100000) self.AddEquity("SPY", Resolution.Minute) def OnData(self, data): if not self.Portfolio.Invested: self.SetHoldings("SPY", 1.0)
Debug
Known issues
breakingStubs version numbers are build-based, not semver. Upgrading may introduce incompatible type signatures without a major version bump.
fix
Pin to a specific version and test after upgrade: pip install quantconnect-stubs==17685
affects: all
gotchaThe stubs are generated and may contain incomplete or incorrect type annotations. Do not rely on them for runtime behavior.
fix
Validate against official QuantConnect documentation for APIs used.
affects: all
deprecatedOld import paths like 'from QuantConnect.Algorithm import QCAlgorithm' may work but are deprecated in favor of 'from Algorithm import QCAlgorithm'.
fix
Use the new import path: from Algorithm import QCAlgorithm
affects: >=17685
Upgrade
Version history
17685latest on PyPI · released Apr 24, 2026
Audit
Dependencies
QuantConnectrequiredThe stubs are for the QuantConnect Lean engine, which must be installed separately (not on PyPI; typically via Docker or local build).
Agent activity
32 hits · last 30 days
node
28
Bingbot
1
OpenAI (training)
1
Resources