The VS Code Integrated Development Environment (IDE) lets you work on research notebooks and develop algorithms for backtesting and live trading. When you open a project, the IDE automatically displays. You can access your trading algorithms from anywhere in the world with just an internet connection and a browser.

Supported Languages

The Lean engine supports C# and Python. Python is less verbose, has more third-party libraries, and is more popular among the QuantConnect community than C#. C# is faster than Python and it's easier to contribute to Lean if you have features written in C# modules. Python is also the native language for the research notebooks, so it's easier to use in the Research Environment.

The programming language that you have set on your account determines how autocomplete and IntelliSense are verified and determines the types of files that are included in your new projects. If you have Python set as your programming language, new projects will have .py files. If you have C# set as your programming language, new projects will have .cs files.

Change Languages

Follow these steps to select a programming language:

  1. Log in to the Algorithm Lab.
  2. In the top navigation bar, click yourUsername > My Account.
  3. On your Account page, in the Account Settings section, click C# or Python.
  4. "Preferred language setting has been updated" displays.

Autocomplete and Intellisense

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. Local auto-complete is also available for select IDEs.

Use Autocomplete

Before you use autocomplete, you may need to run the following command in a terminal to get the latest Python stubs:

$ pip install --upgrade quantconnect-stubs

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.

  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.

Cloud Terminal

The Cloud Terminal panel at the bottom of the IDE shows API messages, errors, and the logs from your algorithms.

The Problems tab of the panel highlights the coding errors in your algorithms.

Navigate the File Outline

The Outline section in the Explorer panel is an easy way to navigate your files. The section shows the name of classes, members, and functions defined throughout the file. Click one of the names to jump your cursor to the respective definition in the file. To view the Outline, open a project and then, in the left navigation menu, click the Explorer icon.

Split the Editor

The editor can split horizontally and vertically to display multiple files at once. Follow these steps to split the editor:

  1. Open a project.
  2. In the left navigation bar, click the Explorer icon.
  3. In the QC (Workspace) section, drag and drop the files you want to open.

Show and Hide Code Blocks

The editor can hide and show code blocks to make navigating files easier. To hide and show code blocks, open a project and then click the arrow icon next to a line number.

Keyboard Shortcuts

Keyboard shortcuts are combinations of keys that you can issue to manipulate the IDE. They can speed up your workflow because they remove the need for you to reach for your mouse.

Follow these steps to view the keyboard shortcuts of your account:

  1. Open a project.
  2. Press F1.
  3. Enter \"Preferences: Open Keyboard Shortcuts\".
  4. Click Preferences: Open Keyboard Shortcuts.

To set a key binding for a command, click the pencil icon in the left column of the keyboard shortcuts table, enter the key combination, and then press Enter.

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: