Skip to content

Latest commit

 

History

History
73 lines (39 loc) · 2.67 KB

readme.md

File metadata and controls

73 lines (39 loc) · 2.67 KB

Local Development with Visual Studio

This document contains information regarding ways to use Visual Studio to work with the Lean engine, this includes a couple options that make lean easy to develop on any machine:

  • Using Lean CLI -> A great tool for working with your algorithms locally, while still being able to deploy to the cloud and have access to Lean data. It is also able to run algorithms locally through our official docker images **Recommended for algorithm development.

  • Locally installing all dependencies to run Lean with Visual Studio on your OS.


Setup

Option 1: Lean CLI

To use Lean CLI follow the instructions for installation and tutorial for usage in our documentation.


Option 2: Install Locally

  1. Install .Net 6 for the project

  2. (Optional) Get Python 3.8.13 for running Python algorithms

    • Follow Python instructions here for your platform
  3. Get Visual Studio

  4. Get Lean into VS

Your environment is prepared and ready to run lean


How to use Lean

This section will cover configuring, launching and debugging lean. This is only applicable to option 2 from above. This does not apply to Lean CLI, please refer to CLI documentation


Configuration

We need to be sure that our Lean configuration at .\Launcher\config.json is properly set.

Your configuration file should look something like this for the following languages:

Python:

"algorithm-type-name": "**AlgorithmName**",

"algorithm-language": "Python",

"algorithm-location": "../../../Algorithm.Python/**AlgorithmName**.py",

C#:

"algorithm-type-name": "**AlgorithmName**",

"algorithm-language": "CSharp",

"algorithm-location": "QuantConnect.Algorithm.CSharp.dll",

Launching Lean

Now that lean is configured we can launch. Use Visual Studio's run option, Make sure QuantConnect.Lean.Launcher is selected as the launch project. Any breakpoints in Lean C# will be triggered.


Common Issues

Here we will cover some common issues with setting this up. Feel free to contribute to this section!