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:

  1. Open Local Platform.
  2. Press F1.
  3. Enter "Python: Select Interpreter".
  4. Press Enter.
  5. If a project is open, click Select at workspace level.
  6. The Select Interpreter window shows the path to your Python executable path. It's the path next to the star icon.

    VSCode window that shows the python executable path
  7. Open a terminal and run <pythonExecutablePath> -m pip install quantconnect-stubs.
  8. $ D:\python-3.10\python.exe -m pip install quantconnect-stubs --upgrade

Use Autocomplete

Follow these steps to use autocomplete:

  1. Open a project.
  2. Type the first few characters of a variable, function, class, or class member that you want to autocomplete (for example, self.setSet or SimpleMovingAverage.Upda).
  3. Press CTRL+Space.
  4. If there are class members that match the characters you provided, a list of class members displays.

    Autocomplete helper Autocomplete helper
  5. Select the class member that you want to autocomplete.
  6. The rest of the class member name is automatically written in the code file.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: