Development Environment
Autocomplete
Introduction
Intellisense is a GUI tool in your code files that shows auto-completion options and presents the members that are accessible from the current object. The tool works by searching for the statement that you're typing, given the context. You can use Intellisense to auto-complete method names and object attributes. When you use it, a pop-up displays in the IDE with the following information:
- Member type
- Member description
- The parameters that the method accepts (if the member is a method)
Use Intellisense to speed up your algorithm development. It works with all of the default class members in Lean, but it doesn't currently support class names or user-defined objects.
Install Python Stubs
Before you use autocomplete, you may need to follow these steps to get the latest Python stubs:
- Open Local Platform.
- Press F1.
- Enter "Python: Select Interpreter".
- Press Enter.
- If a project is open, click .
- Open a terminal and run
<pythonExecutablePath> -m pip install quantconnect-stubs
.
The Select Interpreter window shows the path to your Python executable path. It's the path next to the star icon.
$ D:\python-3.10\python.exe -m pip install quantconnect-stubs --upgrade
Use Autocomplete
Follow these steps to use autocomplete:
- Open a project.
- Type the first few characters of a variable, function, class, or class member that you want to autocomplete (for example,
self.set
Set
orSimpleMovingAverage.Upda
). - Press CTRL+Space.
- Select the class member that you want to autocomplete.
If there are class members that match the characters you provided, a list of class members displays.
The rest of the class member name is automatically written in the code file.