1  Introduction

1.1 Becktesting engine (Quantconnect)

In most cases, you will use a backtesting engine to test your trading strategies. A backtesting engine is a software that simulates the performance of a trading strategy on historical data. There are many backtesting engines available. We mostly use Quantconnect.

Quantconnect is cloud platform for quant research and trading based on LEAN engine, which is open source. It supports backtesting and live trading. It is written in C# and supports python. It has a lot of data sources, and it is relatively easy to use. It is a perfect environment for backtesting trading strategies and simple migration to paper/live trading.

Similar, to programming languages, we want to teach you how to use Quantconnect. Here are some recommendations:

  • register as a new user on Quantconnect, homepage
  • go through bootcamps that can be found on Quantconnect site by clicking on Algorithm Lab > Learning Center,
  • go through You Tube video series,
  • Read the Quantconnect documentation

It is not necessary to go into details. The recommendation is to start with equity for the beginning. Later you can try with options/futures or some other asset classes. You can use python and C#, but we recommend to use python. Python is much more used in finance, and it has numerous packages that make your job easier.

Except Quantconnect, there are other backtesting platforms. Here are some for information, you can check them if you want:

  • Zorro - Writing fast trading strategies in C-lite or C++,
  • Natulius trader - write trading strategies in python or rust,
  • Backtrader - very popular backtesting engine written in pure python,
  • Vectorbt - vectorized backtester in python,
  • Some people develop their own backtester, but we don’t recommend it for beginners, except for simple strategies that include loops for quick analysis.

1.2 Programming languages

The most used programming language in the world of finance is Python. It is a high-level programming language that is relatively easy to learn and use. Other popular programming languages in finance include R, C++, Java, and MATLAB. In our researching process, backtesting and deployment, we mostly use R, python and, occasionally, C++. Learning one of these languages is a must for every quant. The more languages you know, the more versatile you are.

We can’t teach you any of these languages in this book. We can only give you some recommendations on how to learn them. We recommend to start with Python, as it is the most used language in finance. You can learn it through online tutorials, books, or courses. There are plenty of sources online. It also depends on your preferences, watch videos read books…

If you are a beginner, we recommend to start with DataCamp . It has a lot of courses for beginners and advanced users. Second, don’t just learn the language, start developing strategies as soon as possible. The best way to learn a programming language is by using it. Just start the project in your favorite IDE (say VS code) and start coding.

If you prefer R, we recommend you to start learn following packages: - data.table - for all data wrangling tasks. It is faster than dplyr in R and pandas in python and uses less memory. - ggplot - for visualization. - PerformanceAnalytics - for calculating various portfolio or individual stock performances. - runner - for creating rolling and expanding windows. Here only one function is important. - lubridate - for working with times in R (converting time zones and similar). - mlr3 (optional, if you use ML, (Binder et al. 2023)) - Something like scikit learn in python. - Rcpp (optional, if you want to use c++ within R). - The biggest advantage of R is the rich set of statistical packages that are already developed. By simply googling you can quickly find a lot of information. You need GARCH? Use ugarch package. You need ARIMA? Use forecast package. You need to calculate VaR? Use rugarch package. And so on.

All above packages are learned continuously, through the development of strategies and projects. Every day you learn something new.

1.3 Data

List of vendors are available on the link

We would like to add two more sources:

  • Databento - new data provider for very quality and granular market data.
  • Financial Modeling Prep (FMP) - free and paid data provider for various type of data.

We use daily and hour OHLCV (open, high, low, close price, volume) data from Algoseek (bought from Quantconnect) and minute data from Databento. We also use fundamental data from FMP.

1.4 Start developing strategies as soon as possible

Except learning programming languages and backtesting engines, you should start developing strategies as soon as possible. The best way to learn is by working. When you start developing strategies, start with simple ones. The more complex the strategy, the more difficult it is to debug and understand. We will give you some recommendations on how to start developing strategies in next section.

Your task would be to develope: 1) an existing strategy for you to study and potentially improve (we can discuss together how it can be improved). 2) a new strategy that you can test through a script/notebook in a programming language of your choice and/or Quantconnect.

1.5 Synchronization through syncthing

We use syncthing for synchronization of files between team members. It is a decentralized file synchronization tool that is very easy to use. It is open source and free. You can download it from https://syncthing.net/. It is available for all operating systems.

Here are the steps you need to do to start using syncthing and synchronize with our server:

  • Download syncthing on the link. Read this Getting started guide to learn how to download and use it.
  • After you download it, start it. You will see a web interface in your browser.

1.6 Literature review

1.6.1 Portfolio optimization

  • Portfolio optimization by Daniel P. Palomar. It-s free! The book provides a comprehensive introduction to the field of portfolio optimization, with a focus on modern techniques derived from convex optimization. The book covers a wide range of topics, including mean-variance optimization, robust optimization, and factor models. It also includes practical examples and exercises to help readers apply the concepts to real-world problems.

  • Quantitative Portfolio Management: The Art and Science of Statistical Arbitrage by Michael Isichenko - This book provides a comprehensive introduction to the field of quantitative portfolio management, with a focus on statistical arbitrage.

1.6.2 Financial econometrics

  • Financial Econometric Modeling Stan Hurn, Vance L. Martin, Peter C.B. Phillips, Jun Yu - This book provides a comprehensive introduction to the field of financial econometrics, with a focus on practical applications in finance. The book covers a wide range of topics, including time series analysis, volatility modeling, and factor models. It also includes practical examples and exercises to help readers apply the concepts to real-world problems.

  • Analysis of Financial Time Series by Ruey S. Tsay. This book provides a comprehensive introduction to the field of financial econometrics, with a focus on time series analysis. The book covers a wide range of topics, including volatility modeling, factor models, and forecasting. It also includes practical examples and exercises to help readers apply the concepts to real-world problems.

  • Nonlinear Time Series Analysis by Ruey S. Tsay and Rong Chen. This book provides a comprehensive introduction to the field of nonlinear time series analysis, with a focus on practical applications in finance.

  • Ben Lambert’s Econometric Course - this is general introduction to econometrics. Emphasize is not on financial econometrics.

1.6.3 Financial machine learning

  • Advances Financial Machine Learning by Marcos Lopez de Prado. This book provides a comprehensive introduction to the field of financial machine learning, with a focus on practical applications in quantitative trading. The book covers a wide range of topics, including feature engineering, model evaluation, and portfolio construction. It also includes practical examples and exercises to help readers apply the concepts to real-world problems.

  • Machine Learning for Algorithmic Trading: Predictive models to extract signals from market and alternative data for systematic trading strategies with Python by Stefan Jansen. This book provides a comprehensive introduction to the field of machine learning for algorithmic trading, with a focus on practical applications in quantitative trading. The book covers a wide range of topics, including data preprocessing, feature engineering, and model evaluation. It also includes practical examples and exercises to help readers apply the concepts to real-world problems.

1.6.4 Quantitative Trading Strategies

  • Quantitative Trading: How to Build Your Own Algorithmic Trading Business by Ernie Chan - This book provides a comprehensive introduction to the field of quantitative trading, with a focus on building and testing algorithmic trading strategies. The book covers a wide range of topics, including backtesting, risk management, and execution. It also includes practical examples and exercises to help readers apply the concepts to real-world problems.

1.6.5 Statisticla Arbitrague