Generate code in 3 minutes
Enter your idea and AI generates runnable code.
To run your trading algorithm on an older version of the LEAN engine in QuantConnect, you can use the LEAN Version selector located in your project settings. This is particularly useful if you need to delay migration to newer API standards (such as the PEP8 migration) or if your strategy relies on specific behaviors of previous builds.
self.securities vs self.Securities) introduced in newer updates, but it is recommended to update your code to the latest standards eventually.Q: Why would I need to select an older LEAN version?
A: You might select an older version to maintain compatibility with legacy code that has not yet been updated to match recent API changes, such as the Python PEP8 migration which introduced snake_case naming conventions.
Q: What is the specific version number for the pre-PEP8 LEAN engine?
A: The version that supports the old API format before the PEP8 migration is master v16356.
Q: Does changing the LEAN version affect all my projects?
A: No, the LEAN Engine setting is configured on a per-project basis. You must change the setting individually for each project you wish to run on an older engine.
Q: What happens if I create a new project without changing settings?
A: New projects automatically use the latest master branch of LEAN (v16357+), which enforces the newest API standards and formatting.