Meta

Creating BootCamp Tutorials

Creating BootCamp Tutorials


Updated July 14th, 2019: The create BootCamp tutorial is a work in progress.

Introduction

BootCamp is an interactive, education system for teaching the community the QuantConnect API, and the structure for building an algorithm. In January 2019, QuantConnect opened up the BootCamp technology to allow contributions of tutorials from the community! This guide seeks to show you how to create a BootCamp tutorial.

Education and access to the information required to compete is a the cornerstone of QuantConnect's mission for radical openness, and the democratization of finance. With your help we can train the community on how to make the best algorithms possible.

Requirements

Ensuring high-quality writing in BootCamp lessons is important to maintain the interest and motivation of the community. The skills required to build a BootCamp lesson cover several areas of expertise:

  1. QuantConnect API: Contributors must have knowledge of the QuantConnect API along with the correct way to implement the desired behavior.
  2. Programming Polygot: BootCamp algorithms are provided in both C# and Python. The text documentation is written in HTML, and the task validation code is performed in JavaScript. You should be able to code neatly in all four languages.
  3. Principles of Algorithmic Trading: Domain expertise in finance is important to be able to build thoughtful and educational content.

The combination of all these talents is fairly rare so we're reaching out to the community to help us create this content. If you can cover all three of these categories let us know and we'll enable BootCamp editing permissions on your account. In exchange for a completed BootCamp lesson we're offering compensation which we'll cover in the section below.

Compensation

QuantConnect is offering contributing authors compensation for their BootCamp Lesson submissions. Depending on the complexity and topics covered a lesson ranges from $2,000 to $4,000USD.

Difficulty Compensation Estimated Effort

Beginner

$2,000USD

3-5 days fulltime work

Intermediate

$3,000USD

4-6 days fulltime work

Advanced

$4,000USD

5-8 days fulltime work

Before starting a lesson reach out to the QuantConnect team for approval on the lesson concept. We are seeking to provide diverse and complementing content for the community. If you're interested in creating BootCamp lessons but don't have a topic in mind get in touch with us!

Content Structure

BootCamp is divided into Lessons, and Tasks. A Lesson focuses on the implementation of a single algorithm. A Task breaks up the algorithm implementation into tiny steps which can each be easily coded, with the aim of guiding the user through each layer of the algorithm design.

Core Principle

The central guiding principle of BootCamp lessons is they are focused on the implementation of a single algorithmic trading strategy. At each level of the system, the titles should be directly related to the implementation of the strategy, not the concepts it is covering. This is actually quite difficult, but one way to help to get into this mindset is to focus on teaching how to implement the strategy.

  • Lesson: Buy and Hold Algorithm
    • Task: Initializing Your Algorithm -> Set Cash

Lessons

A Lesson is a collection of tasks aiming to implement a single algorithmic strategy step by step. A lesson should be comprised of about 6-12 tasks, where each task builds upon the lessons learned from the previous task. We have built a system for the community to design and submit Boot Camp lessons and tasks.

Tasks

A Task is the atomic unit of the Boot Camp system. It is a single step required to be completed in the pathway to an algorithm. Tasks are grouped with a subheading according to algorithm implementation concept. A task should aim to implement just few lines of code so that each task can be easily achieved.

Planning Your Lesson

Carefully planning and structuring your lesson is critical to ensuring its success. In the next section, we'll create this plan step by step. Boot Camp lessons typically fall into one of the following algorithm types: Macro Economics, Technical Indicators, Scaling, Market Making, Market Microstructure, Sentimental, or Value-Fundamental Investing.

1. Strategy Selection

Every BootCamp lesson is focused on an algorithmic strategy's implementation. The first step to planning a lesson is choosing a strategy which does not overlap with any of the existing BootCamp topics. This can be incrementally more difficult but should introduce new concepts.

2. Strategy Implementation

After selecting your strategy you need to fully implement the algorithm, writing the code in C# and Python as simply as possible. Users new to coding have a hard time deciphering large blocks of code so strategies should be kept very simple.

In writing the strategy remain aware of the conceptual layers you put into the algorithm's codebase. These layers of concepts are where you can separate out the lesson tasks. For example: in writing a lesson "Buy and Hold, with Trailing Stop" you might start by coding up the buy and hold logic, followed by placing a "trailing stop" (Stop Market Order), then finally you can make the stop move by updating its trigger price. These conceptual layers form the basis for how tasks are grouped together.

QuantConnect has worked with the community to create a list of lessons to be created which would be eligible for compensation. The table below describes these strategies and their associated difficulty level.

Beginner BootCamp Lessons Status

Buy and Hold (Equities/Forex)
Strategy purchasing assets and holding them for the duration of the algorithm. Seeking to demonstrate how to initialize an algorithm and access price data.

Accessing DataInitializing Algorithms

Completed

Buy and Hold with Trailing Stop
Placing and updating a stop-market order combined with basic charting to visualize the stop price movement.

Order ManagementBasic Charting

Completed

Momentum-Based Tactical Allocation
Using a momentum indicator to shift investment between the S&P500 to a Bond ETF. Introducing multiple asset portfolios and the use of an indicator.

Multi-Asset Portfolio Using Indicators Equities

Completed

Open Range Breakout
Uses consolidators to aggregate the first 20 minutes of a day and trades when the price moves beyond that range. Introduces custom period consolidated price bars.

Consolidators Equities

Assigned

Liquid Universe Selection
Using a universe selection filter, invest in the top 10 stocks which are liquid and cost more than $10 per share. Introduces universe selection features.

Universes Price Volume Filtering Equities

Assigned

200-50 EMA Momentum Universe
Select assets where the 50-EMA is greater than the 200 EMA. Seeking to introduce creating structures to contain symbol specific data, and using the history API to warm them up.

Universes SymbolData Pattern History Equities

Assigned

Fading The Gap
Using scheduled events to monitor for overnight price gaps in the market and shorting abnormal activity. Introduces scheduled events, and elimination of a parameter with STD indicator.

Scheduled Events STD Indicator Parameter Minimization Equities

Assigned

Intermediate BootCamp Lessons Status

Separation of Concerns with the Algorithm Framework
A simple strategy to buy SPY each morning on market open using the algorithm framework - a scaffolding for powerful strategy design.

Algorithm Framework Execution Model Portfolio Model Universe Selection Model

Assigned

Pairs Trading with SMA
Simple pairs trading strategy monitoring for divergence in correlation of two hand picked assets. Invests in a market neutral manner, using position sizing to calculate the right holding of each asset.

Pairs Trading Market Neutrality Position Sizing Equities

Assigned

Pairs Trading with Cointegration Test
Scanning a basket of assets monthly for potential cointegration and making a pairs trade when detect a divergent pair. Using scheduled events for the cointegration test, and

Pairs Trading Cointegration Test Scheduled Events Equities

Assigned

Liquid Value Stocks
Selecting a universe of the 100 most liquid assets and rank by their PE-Ratio to get the best value stocks. Each month buy the 10 best value stocks, and short the worst value stocks.

Universe Selection Fine Universe Selection Long-Short Hedge Equities

Assigned

Sector Balanced Universe Selection
Selecting an equally weighted universe of assets covering 33% technology stocks, 33% finance and 33% consumer goods.

Universe Selection Advanced Universe Selection Sector Exposure Equities

Assigned

Hedging FX Books with Interest Rate
Harnessing an alternative data source (Trading Economics) to invest proportionately with interest rate changes in the underlying economies.

Trading Economics Alternative Data Global Macro Forex

Available

Sentiment Analysis on Stocks
Harness Psychsignal data to rank the sentiment of a basket of US Equity stocks and invest in those with the most postive sentiment.

Psychsignal NLP Alternative Data Sentiment Analysis Equities

Available

Advanced BootCamp Lessons Status

Coming Soon

Writing a Lesson

Writing a BootCamp lesson starts by carefully writing out the complete code for the strategy, breaking it into tasks, and write small text summaries for each task with the documentation required to teach the reader how to complete the task. Finally, JavaScript is used to read the exhaust output of the algorithm to validate it achieved the required objective.

Lesson Algorithm
Task Guides
Validators
Hints, Solutions
Submit

1. Write Lesson Algorithm

Writing a BootCamp lesson starts by carefully writing out the complete code for the strategy. This should be drafted as simply as possible to ensure each task the student needs to complete will only be 2-5 lines of code.

Readability is critical and the code should be well commented with descriptive variable names. Depending on the complexity of the algorithm sometimes its more readable to use string tickers instead of class variables.

Carefully write code in a way which neatly separates the algorithm concepts as much as possible. Keep in mind the algorithm will be implemented in separate tasks by the student.

Action:

Write highly readable, concise C# and Python versions of the algorithm and request review by QuantConnect Education team. Plan ahead for divisions of the code into tasks.

2. Write Task Guides

Each task has a short write-up to explain the features needed to complete the next task of BootCamp. This write-up should assume the student has no prior knowledge and include representative code snippets demonstrating the key API code needed.

StyleExample Code Tag

Headings

<h4>Initializaing Algorithms</h4>

Paragraphs

<p>Setting cash is done with <span class="python">self.SetCash().</span></p>

Code Snippets

<pre class="prettyprint python">self.SetCash()</pre>

For a fluent experience between lessons, all content should follow the same structure as the sections laid out below.

Tasks start their contents divided by subtitle using the h4 tag. Use a short title about the specific API or content you're trying to summarize.

After each heading, write a short paragraph concisely summarizing the content in as few words as possible. Use inline <code> blocks to highlight API syntax, and links to new tabs referencing any documentation required.

Any content which is specific to one programming language should be wrapped in a span tag with the language set in the class, for example: <span class="python">. Each section should include a code snippet of documentation using a <pre class="prettyprint"> code block.

Finally, each task should define 2-4 objectives to achieve in the task. These tasks should guide the user on the required steps to implement the strategy step. At the end of the task, there should be a measurable output that the system can use to judge if the task is a success. This can be a state change of the algorithm, a debug/log statement, or a trade. This will be covered in the next section, Code Validators.

Building Code Validators

Validators Partial Class Validating algorithm output Examples of validation

Style Guide

H4 titles, verbs describing strategy step Brief Short sentences, Aim for no more than 3 todo's per task Hint should give enough information to complete the task. technical grammar, present tense.

Submitting Lesson for Review

Lesson submission

Summary

You can also see our Documentation and Videos. You can also get in touch with us via Chat.

Did you find this page Helpful ?