Key Concepts
Getting Started
Introduction
Quantitative trading is a method of trading where computer programs execute a set of defined trading rules in an automated fashion. Quants take a scientific approach to trading, applying concepts from mathematics, time series analysis, statistics, computer science, and machine learning. Compared to discretionary traders, quants can respond faster to new information and are at less risk to their emotions during trades. Since quants can concurrently trade many strategies while discretionary traders only have the mental bandwidth to trade a small number of concurrent strategies, quant traders can have more diversified portfolios.
Learn Programming
We aim to make it as easy as possible to use QuantConnect, but you still need to be able to program. The following table provides some resources to get you started:
Language | Type | Name | Producer |
---|---|---|---|
C# | Video | C# Fundamentals for Absolute Beginners | Microsoft |
C# | Text | C# Jump Start - Advanced Concepts | Microsoft |
C# | Video | Top 20 C# Questions | Microsoft |
C# | Text | C# Tutorial | tutorialspoint |
Python | Text | Introduction to Financial Python | QuantConnect |
Python | Text/Video | Introduction to Python | |
Python | Interactive | Code Academy - Python | Code Academy |
Python | Text | Python Pandas Tutorial | tutorialspoint |
Learn Jupyter
The following table lists some helpful resources to learn Jupyter:
Type | Name | Producer |
---|---|---|
Text | Jupyter Tutorial | tutorialspoint |
Text | Jupyter Notebook Tutorial: The Definitive Guide | DataCamp |
Example
The following snippet demonstrates how to use the Research Environment to plot the price and Bollinger Bands of the S&P 500 index ETF, SPY:
The following snippet demonstrates how to use the Research Environment to print the price of the S&P 500 index ETF, SPY:
// Load the required assembly files and data types #load "../Initialize.csx" #load "../QuantConnect.csx" using QuantConnect; using QuantConnect.Data; using QuantConnect.Algorithm; using QuantConnect.Research; // Create a QuantBook var qb = new QuantBook(); // Create a security subscription var symbol = qb.AddEquity("SPY").Symbol; // Request some historical data var history = qb.History(symbol, 70, Resolution.Daily); foreach (var tradeBar in history) { Console.WriteLine($"{tradeBar.EndTime} :: {tradeBar.ToString()}"); }
# Create a QuantBook qb = QuantBook() # Create a security subscription spy = qb.AddEquity("SPY") # Request some historical data history = qb.History(qb.Securities.Keys, 360, Resolution.Daily) # Calculate the Bollinger Bands bbdf = qb.Indicator(BollingerBands(30, 2), spy.Symbol, 360, Resolution.Daily) # Plot the data bbdf.drop('standarddeviation', 1).plot()
