QuantConnect: Getting Started Introduction

As regular readers will know, the content on this site has been centered around two platforms. To be more specific, those platforms are Backtrader and Tradingview. The reason for this is simply that they happened to be the best fit for me when I first started out on this journey.

Like most people, before deciding to invest my time in these platforms, I took a look at several other options first. QuantConnect was just one of those other platforms. However, after spending a little time poking around the site, I ultimately decided QuantConnect wasn’t for me at that time.

Recently, I felt it was time to take another look. After all, technology moves at a rapid pace and I knew the platform will have come a long way since my first visit. Also, after spending a lot of time developing for other platforms, I now have a fresh perspective and a different outlook on what is important to me.

So dust off your spectrophotometer and join me in starting a new journey as a beginner on the platform. Let’s see if the grass really is greener on the other side.

QuantConnect

For those of you who are not familiar, QuantConnect is an online platform that allows users to write, collaborate and even get funding for trading algorithms. Code is generally written in the browser and backtested online using QuantConnects data and computing power.  

Link: https://www.quantconnect.com/

Initial Thoughts

Before we develop our first script, I will provide some initial thoughts (both good and bad) on the platform in general. This may help readers to quickly evaluate whether to continue on this journey or not.

First, let’s talk about the good stuff! There are some really nice aspects to QuantConnect that and you will get to see these for yourself as this series progresses. But what really stands out to me is the sheer amount of data that is available to users. It is easy to access and means we don’t need to go to the trouble of sourcing and maintaining our own data. Anyone who has tried to do this before will know that it is either a time-intensive or expensive!

QuantConnect also supports a number of programming languages (Python, C# and F). This is great for a semi-walled gardened online platform. You can program in a language that you are familiar with instead of having to learn a scripting language like Pine-Script on Tradingview.

Broker Integration

Another huge benefit is tight integration with a number of real Brokers. Of course, Backtrader also supports broker integration but QuantConnect has official partnerships in place. Further, they provide virtual machines to make deployment of an algorithm easy and ensure solid uptime. Deploying a live algorithm is as easy as flipping a switch at the top of the UI and selecting your broker. No changes to your code are needed.

Live Trading mode on QuantConnect

If you are interested in live trading, QuantConnect offers several types of server and account subscriptions (Backtesting is free). The price to deploy a live trading server is quite reasonable at only $20 a month. This gives you full access to infrastructure and tools that would take a long time to develop in other frameworks such as Backtrader. Furthermore, if you are a customer of Oanda, they actually subsidize the server cost, making it FREE!

A Balanced View

If we are to give a balanced view, we should be critical and honest about the shortcomings of the platform (of which there are a few).

  • Developing, debugging and testing is a long, slow process if you stick to using the online platform. Just running your code one time can take up to 30 seconds to build, analyze and run the code. Analyzing alone takes 15 seconds on average and this must be done before you see any type of error. So if you are exploring or debugging and trying out different things, be prepared for slow progress. To be fair, there does appear to be an option to develop locally. Users can download the lean engine and run it locally. However, I believe most casual/retail users will not go down that path.
  • Documentation, although there is a lot of it, I personally found it difficult to find what I am looking for. C# Programmers have an excellent co-pilot feature that makes documentation suggestions and provides snippets from the various online resources. Unfortunately, co-pilot is not available in Python, my language of choice.
  • USA – Centric: The data available is really spectacular but it is very focused on US markets. If you want to backtest equities in the rest of the world, you still need to source your own data. Having said that, Forex, Crypto and CFD’s are available for people not interested primarily in US equities.

Resource Limits: 

Because we are using other peoples resources, sensible limits need to be placed. Naturally, QuantConnect does not want one user to accidentally crash the system or hog all the resources. As such, some of these limitations are:

  • Plotting Limits: Each chart is limited to a certain number of points. If you exceed the maximum number of points, plotting is skipped/stopped. As such, if you want to perform a really long backtest, you will not be able to fully plot all data point. Therefore, plotting should be performed during shorter test periods to verify the algorithm is working as expected.
  • Daily logging limit. Each user can only create x Kb in log files. This means you need to be a little mindful of the data you decide to print to the logs and ask yourself whether it is truly useful.
  • Packages: Since we are running in a walled-garden environment only a handful of packages are officially available to import. Fortunately, though, the packages we can import are the ones you will likely want to use such a Pandas, Numpy, Sci-kit learn, statsmodels etc.

Let’s Get Started

The next QuantConnect post will cover a basic introduction to getting up and running with Python on QuantConnect. It shall follow a similar format (where possible) to getting started posts for the other platforms on this site.