QuantConnect Lean


Last week I spent some time learning the basics of QuantConnect Lean, the engine that our group is using to create our stock market trading algorithms. I have no experience with algorithmic trading, so it took a good amount of effort to get comfortable with running basic algorithms using the engine. To complicate things further, there are also two options for backtesting algorithms: one is to clone the Lean repository, update a configuration file with the specific algorithm(s) and its language (Python or C#) that you are looking to run, and then to build and run the solution using Visual Studio.

My approach was to first learn how to use the local method to make sure that I understood what was going on behind the scenes before using the more abstract CLI method. Luckily, Lean provides a sample algorithm that is automatically configured by default. So once I figured out how to update the configuration file and build and run the solution, I was able to confirm that I backtested the algorithm successfully because I was presented with metrics that would have contained meaningful data if a real algorithm was used.

The CLI method actually took more effort to get up and running because it required some more specific installations (e.g., required Anaconda), but once I learned the basic commands to create and backtest a project, I definitely found it simpler to use that the local method. I received some help from my teammate Travis to create a basic algorithm that mocked making purchases of the stock UDOW over a one-year period using price data provided by Yahoo Finance. After some trial and error I was pleased to see that the algorithm was working correctly and I could see many interesting metrics that were now meaningfully populated. I am looking forward to learning more about QuantConnect Lean and am hoping to create some advanced and effective trading algorithms over the next couple of months!


Leave a Reply

Your email address will not be published. Required fields are marked *