Projects

IDE

Introduction

The 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. The web IDE enables you to access your trading algorithms from anywhere in the world with just an internet connection and a browser. If you prefer to use a different IDE, the CLI allows you to develop locally in your preferred IDE.

Supported Languages

The Lean engine supports C# and Python. The engine is written in C#, so it is the native language. However, Python is supported using Python.NET. Comparing the languages, C# is faster than Python and it's easier to contribute to Lean if you have features written in C# modules. In contrast, Python is less verbose, has more third-party libraries, and is more popular among the QuantConnect community than C#. 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. Enable and disable Intellisense in the Algorithm Lab. Local auto-complete is also available for select IDEs.

Use Autocomplete

You need to enable the Code Completion setting on your account to 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.

  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.

If you don't see the Cloud Terminal in your project, follow these steps to open it:

  1. Press F1.
  2. Enter "View: Toggle Cloud Terminal".
  3. Click View: Toggle Cloud Terminal.

Manage Nodes

The Resources panel shows the backtesting, research, and live trading nodes within your organization. To view the panel, open a project and then, in the right navigation menu, click the Resources icon.

The panel displays the following information for each node:

ColumnDescription
NodeThe node name and model.
In Use ByThe owner and name of the project using the node.

To stop a running node, click the stop button next to it. You can stop nodes that you are using, but you need stop node permissions to stop nodes other members are using.

By default, we select the best node available in your clusters when you launch a backtest or research notebook. To use a specific node, click the check box next to a node in the panel.

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 right navigation menu, click the Explorer icon.

Split the Editor

The editor can split horizontally and vertically to display multiple files at once. To split the editor, open a project and then 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.

Themes

The Algorithm Lab offers light and dark themes. Follow these steps to change themes:

  1. Log in to your account.
  2. In the top navigation bar, click yourUsername > My Account.
  3. On your Account page, in the Account Settings section, click Light Theme or Dark Theme
  4. Your Account page refreshes and displays the new theme.

Supported Browsers

The IDE works with Chrome, Edge, Firefox, and Safari. For more information about browser support, see Browser Support in the Visual Studio Code documentation.

Cookies

You need third-party cookies enabled on your browser to use the IDE. To enable third-party cookies, see the support page of the following browsers:

Common Errors

The internet protection of some anti-virus products block the service works that the IDE needs to operate. Kaspersky and Avast are the two products that commonly block the service workers.

The DNS settings of some ISPs block Microsoft DNS, so some panels don't load and display the following message: "Server IP address could not be found". To solve this issue, configure your network settings to use Google Public DNS.

Save Images

Follow these steps to save an image from a Research Environment notebook:

  1. Drag and drop the image into a new tab in your browser.
  2. In the new tab, right click the image and then click Save Image As....

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: