*** Proof of Product ***
Exploring the Essential Features of “Thomas Starke – Trading Alphas: Mining, Optimisation, and System Design – QuantInsti”
Why should you choose micro alpha models over other trading strategies such as traditional factor models, risk-parity, or trend following? In short, these models, if built well, can provide better performance, stability, and risk management than other trading systems. In this course, you will learn where micro-alphas reside and how to write the most efficient codes to quickly analyse, backtest, optimise and go live with your trading strategy in the least amount of time possible.
LEVEL
Advanced
AUTHOR
Dr. Thomas Starke
LIVE TRADING
- Backtesting, adding stop-loss and profit-take using vectorised approach
- Mining micro-alphas using trends, mean-reversion, correlation across assets, and cointegration
- Metrics for analysing strategy which include total profit, sharpe ratio, sortino ratio, profit factor, drawdown, and profit per trade
- Parameter optimisation using machine learning techniques such as clustering
- Building a trading system from scratch
- Explain software architecture, logging, storage, hardware, testing and version control
- Brief study on execution models, implement parallel computing and describe different levels of logging
LEARNING TRACK 8
This course is a part of the Learning Track: Advanced Algorithmic Trading Strategies
INTERMEDIATE
- Mean Reversion Strategies In Python
Momentum Trading Strategies
ADVANCED
- Trading Alphas: Mining, Optimisation, and System Design
- Trading in Milliseconds: MFT Strategies & Setup
PREREQUISITES
Fluency with Python including python libraries like pandas, numpy, matplotlib and concepts of machine learning such as clustering, prediction, in-sample, out of sample and features. Working knowledge to place orders to buy and sell exchange traded assets.
SYLLABUS
Introduction
This course will serve as a step-by-step guide that helps you find the trades based on micro alpha opportunities in the markets today. The interactive methods used in this course will help you not only understand the concepts but also answer all questions about micro alphas. This section also covers the course structure as well as the various teaching tools used in the course, such as videos, quizzes, coding exercises, and the capstone project.
- Introduction
- Course Structure
- Quantra Features and Guidance
Micro Alphas
The efficient market hypothesis states that all information available to the market is contained in the current price. This creates a scenario where it would be impossible to consistently generate profits since the price movements are random and unpredictable. However, there exist ways to exploit market inefficiencies and make money. This section helps you take the first step towards studying micro alphas by establishing a baseline.
- Micro Alphas
- Efficient Market Hypothesis
- Overturn Efficient Market Hypothesis
- Autocorrelation
- Assumption of Technical Indicators
- How to Use Jupyter Notebook?
- Generating Price Series at Random
- Generate Random Numbers
- Scaling
- Generate Price Data
- Statistical Study on Randomly Generated Price Series
- Autocorrelation
- Trading Signals
- Why Did the Signal Fail?
- How to Use Interactive Exercises?
- Additional Reading on Micro Alphas
Market Inefficiencies: Trend
By employing some level of technical expertise, you too can stand a chance of benefiting from inefficiencies in the markets. Market trends are one of these inefficiencies. In this section, you will study how market trends take place. You will also learn how to formulate a strategy based on the relationship between past and current returns.
- Market Inefficiencies
- Trends
- Compounded PnL Curve
- Positive Auto-Correlation
- Positively Correlated Time Series
- Equation for Auto-Correlation
- Value of g
- Strategy for Positive Correlation
- Types of Backtesting
- Compounded PnL Curve
- Auto-Correlation
- Trending Prices
- Series of Returns
- Trend
- Generate Random Returns
- Linearly Fit the Autocorrelated Data
- Backtest the Strategy
- Additional Reading on Trends
Market Inefficiencies: Mean Reversion
Is there a correlation between a stock’s present and past returns that can point to its mean-reverting characteristics? The answer is yes. In this section, you will learn about the type of correlation that leads to mean reversion, how to form a strategy based on the mean-reverting properties of a stock, and also how to combine two strategies to get better results.
- Mean Reversion
- Market Characteristic
- Constant g
- Type of Time Series
- Correlation of Returns
- Strategy and Benchmark Returns
- Strategy Based on Correlation
- Ideal Metric
- Annualised Alpha
- Generate Negatively Autocorrelated Returns
- Additional Reading on Mean Reversion
Trading with Trends and Mean Reversion
In this section, you will learn to create and backtest strategies around market inefficiencies such as trend and mean reversion using real-world data. You will also learn how to compare the strategy returns with the market returns to analyse its performance.
- Trading with Autocorrelated Data
- Calculate Risk-Adjusted Returns
Market Inefficiencies: Chart Patterns
Chart patterns are often used by traders to predict price movements. It’s a type of market inefficiency that can be exploited to gain excess returns (alpha). In this section, you will learn how to backtest multiple patterns at the same time. You will also learn how to formulate a strategy based on the backtested results and assess its performance.
- Chart Patterns
- Define Chart Patterns
- Values of a Candlestick Pattern
- Backtesting
- Library for Candlestick Pattern
- Candlestick Pattern for Micro-Alpha
- Usefulness of Alpha
- Equity Asset Returns
- Chart Patterns
- Extract the Chart Pattern Function
- Chart Pattern Signals
- Calculate Signals
- Capital Allocation
Market Inefficiencies: Correlation, Fundamental and Alternative
In this section, you will learn about a few types of market inefficiencies such as correlation, fundamental data, and alternative data. You will also learn how they impact the price movement and how they can be used to gain excess returns.
- Correlation, Fundamental and Alternative
- Correlation
- Usage of Correlation
- Cross-Sectional Correlation
- Fundamental Inefficiencies
- Inference for Correlation
- Insider Information
- Trading View based on Analyst Forecasts
- Golf and a Company’s Performance
- Correlation
- Calculate Average Correlation
- Additional Reading on Correlation
Market Inefficiencies: Cointegration
Cointegration is the basis of statistical arbitrage. In this section, you will learn how to implement a pairs trading strategy. You will also learn some of the traps of statistical arbitrage and how they can be avoided.
- Cointegration
- Alternative Term for Pairs Trading
- Predictive Model
- Trading the Spread Curve
- Spread Strategy Code
- Cash-Neutral Strategy
- Cointegration
- Hedge Ratio
- Cointegration
- Create a Spread
- Additional Reading on Cointegration
- Types of Market Inefficiencies
Time Series Alphas
There are multiple sources of alphas, and the best known, as well as the most widely used alpha is the time-series alpha. This section will help you generate alpha with signals along the time axis. You will learn how you can use historical time series data to create an RSI-based strategy.
- Time Series Alphas
- Categories of Alpha
- Time Series Alpha
- Types of Alpha
- Problem with Independent Signals
- Number of Signals
- Positions for Time-Series Alpha
- Trading Logic
- RSI Less than 40
- Shift Returns
- PnL Curves
- Strategy vs Benchmark
- Factor in Time-Series Alpha Calculation
- RSI Strategy Logic
- Implementation of RSI Based Trading Strategy
- Calculate RSI
- Generate Signals Using RSI
- Calculate Portfolio Returns
- Additional Reading on Time Series Alphas
Live Trading on Blueshift
Learn how you can take your backtested strategy live with some important steps. Learn about the code structure, the various functions used to create a strategy, and finally, paper or live trade on Blueshift.
- Section Overview
- Live Trading Overview
- Vectorised vs Event Driven
- Process in Live Trading
- Real-Time Data Source
- Blueshift Code Structure
- Important API Methods
- Schedule Strategy Logic
- Fetch Historical Data
- Place Orders
- Backtest and Live Trade on Blueshift
- Additional Reading
Live Trading Template
This section includes a live trading strategy template that uses the RSI indicator to generate entry and exit signals. You can tweak the code by changing securities or the strategy parameters. You can also analyse the strategy’s performance in more detail.
- Paper/Live Trade Using RSI
Cross-Sectional Alphas
Alphas can be generated not just with signals along the time axis, but also with signals along the instrument axis. In this section, you will learn to generate alpha by ranking assets based on their momentum along the instrument axis.
- Cross-Sectional Alpha
- Common Attribute
- Axis for Cross-Sectional Alpha
- Arrange in Order
- Indicator for Trading Signals
- Sum of Rows
- Two Ranks
- Cross-Sectional Approach
- Cross-Sectional Momentum Strategy Logic
- Cross-Sectional Momentum Strategy
- Calculate Momentum
- Backtest Cross-Sectional Momentum Strategy
- Calculate PnL
- Additional Reading on Cross-Sectional Alphas
- Paper/Live Trade Using Cross Sectional Alpha
Timing Alphas
Putting on trades at the right time, hour, weekday, or month can be a significant source of alpha in some cases. In this section, you will learn about the importance as well as the impact of timing the alpha. You will also implement the concepts in a Jupyter notebook.
- Timing Alpha
- Source of Alpha
- Daytime vs Overnight Returns
- Persistent Overnight Returns
- MA Weekday Strategy
- Advantages of Weekday Strategy
- Important Timing Events
- Timing Alphas
- Calculate Overnight Returns
- Inference of Cumulative Returns Plot
- Use of Timing of Alphas
- Additional Reading on Timing Alphas
- Most Suitable Alpha
Combinations of Alpha
Is it possible to combine the different categories of alphas to create a trading strategy? Yes, in this section, you will learn about the various combinations of alphas. You will also implement a volatility-based trading strategy.
- Combinations of Alpha
- Combinations of Alpha
- Alpha Combinations-I
- Annualised Volatility
- Alpha Combinations-IIÂ
- Volatility Strategy
- Upper and Lower Limit
- Upper and Lower Limit Inference
- Volatility Based Trading Strategy
- Calculate Volatility of Stock Returns
- Backtest Volatility Based Trading Strategy with Lower Limit
- Additional Reading on Combinations of Alphas
- Things to Keep In Mind While Combining Strategies
- Paper/Live Trade Using Volatility
Finding Micro-Alphas
For finding micro-alphas, creativity is an indispensable prerequisite, and even slight modifications to old ideas can often deliver great results. In this section, you will be introduced to the research paper “100 Formulaic Alphas” which was published by Kakushadze in 2015. You will learn about some of the alphas and implement them in a Jupyter notebook.
- Finding Micro-Alphas
- Other’s Ideas
- Alpha #3 Factor
- Alpha #3 and Alpha #57
- Ranking RSI Values
- Micro-Alphas From 101 Formulaic Alphas
- Calculate Alpha #6
- Additional Reading on Finding Micro-Alphas
Assessing Results
To understand how well your strategy is working, you need to do a full assessment of the strategy. While it is very important to develop an intuitive sense of the nature of what we are looking at on a chart, this is by no means sufficient for a full assessment. In this section, you will learn about the importance of combining different metrics, which will help you understand a variety of aspects of strategy performance.
- Assessing Results
- Prerequisite for Finding Micro-Alphas
- Combination of Alphas
- Number of Metrics
- Utility of Sharpe Ratio
- Strategy Performance
- Additional Reading on Assessing Results
- Most Ideal Performance Metric
Total Profit
In this section, you will learn about total profit, which is by far the simplest and the most used performance metric. You will learn about compounded and non-compounded as well as realised and unrealised profits. You will also implement these concepts in a Jupyter notebook.
- Total Profit
- Characteristics of Total Profit
- Features of Total Profit
- Differences Between PnL Curves
- Which Strategy is Riskier?
- Reinvestment of Profits
- Realised vs Unrealised PnL
- Drawbacks of Realised PnL
- Drawbacks of Total PnL
- Information Provided by PnLs
- Limitations of Total Profit
- Strategy Comparison
- Impact of Compounded PnL
- Realised Vs Unrealised Profits
- Realised PnL of a Strategy
- Additional Reading on Total Profit
Sharpe and Sortino Ratios
The Sharpe ratio and Sortino ratios help you compare the risk-adjusted performance of different portfolios or trading strategies and determine the most feasible of them all. In this section, you will learn about the two ratios in depth and implement the same using Python.
- Sharpe and Sortino Ratios
- Risk-Adjusted Returns
- Calculate Sharpe Ratio
- Risk-Free Rate
- Exclude Risk-Free Rate
- Drawbacks of Sharpe Ratio
- Sortino Ratio
- Sharpe and Sortino Ratios using Python
- Implement the Sharpe Ratio
- Implement the Sortino Ratio
- Additional Reading on Sharpe and Sortino Ratios
Profit Factor and Drawdown
The Sharpe or Sortino ratios are not suited to evaluate high confidence strategies that take less-frequent but highly profitable trades. In this section, you will learn about the profit factor, which is a good metric to use when we find such types of Alphas. Additionally, the drawdown metric can help us estimate how much we can expect to be underwater at any given time.
- Profit Factor and Drawdown
- Profit Factor
- Compare the Profit Factor
- Drawdown of a Strategy
- Drawdown Calculation
- Maximum Drawdown Comparison
- Profit Factor and Drawdown using Python
- Implement Profit Factor
- Additional Reading on Profit Factor and Drawdown
Profit Per Trade
The profit per trade metric helps you understand the average value you can expect to win or lose per trade. In this section, you will learn about the correct approach for computing profit per trade and you will also learn to compute the same using python.
- Profit Per Trade
- Application of Profit Per Trade
- Computing Profit Per Trade
- Profit Per Trade
- Additional Reading on Profit Per Trade
CAGR, Alpha, and Beta
In this section, you will learn about three popular metrics – CAGR, Alpha and Beta. CAGR helps us determine how much return our strategy is realistically able to generate annually. Alpha shows us how much of the strategy’s return is independent of the benchmark. And the Beta provides us with some insight into our exposure to the underlying market.
- CAGR, Alpha and Beta
- Compounded or Non-compounded?
- Annualise the Sharpe Ratio
- Evaluate the Skill of a Money Manager
- Initial Backtest
- CAGR, Alpha and Beta
- Additional Reading on CAGR, Alpha and Beta
Strategy Execution
You need to be aware of the assumptions you will be making in order to avoid spending time on strategies that are not feasible in the real world or are too costly or complex to implement. Through this section, we will discuss a number of such common assumptions that traders make and how we can deal with them. You will also learn about some interesting execution algorithms such as the arrival price algorithm that may help to enhance your execution performance.
- Strategy Execution
- Implicit Assumptions
- Shortcomings of Execution on Close
- Executing Large Quantities
- Slippage
- Limitation of Market-on-Close Order
- Arrival Price Algorithm
- Execution on the Open
- Order Type for Arrival Price Algorithm
- Sources of Transaction Costs
- Additional Reading on Strategy Execution
Micro-Alpha Portfolio
So far we have discussed how to research, test, evaluate and execute individual alphas. However, the great strength of the micro-alpha approach lies in the combination of many individual alphas. In this section, you will combine multiple alphas and create a combined alpha strategy.
- Combining Alphas
- Traditional Portfolio Management
- Micro-Alpha Approach
- Alphas
- Combining Alphas – I
- Generating Signals
- Combining All Micro-Alphas
- Paper/Live Trade by Combining Micro-Alphas
Portfolio Optimisation
In this section, you will analyse various portfolio optimisation techniques, such as manual optimisation and mean-variance optimisation, by practically applying them to the combined alpha portfolio.
- Portfolio Optimisation
- Rebalance the Weights
- Equal Portfolio Weights
- Efficient Frontier
- Optimisation
- Additional Reading
Advanced Alpha Mining
In this section, you will learn about more advanced alpha mining concepts, such as system parameter permutation and optimisation.
- Testing Robustness Across Parameter Space
- Testing Robustness of Strategy
- Selecting Best Parameter Sets
- Finding Best Parameter
- Possible Lookback Values
- Parameter Optimisation
- Simpson’s Paradox
- Sharpe Ratios
- Lookback Periods
- Clustering Algorithms – I
- Clustering Algorithms – II
- SPP
- Additional Reading – I
- Additional Reading – II
Machine Learning Alphas
In this section, you will learn about machine learning alphas.
- Machine Learning Alphas
- Classification
- ML Alphas
Basics of Vectorized Backtest
Backtests can be done either with loops or in the vectorized format. While a vectorized backtest is relatively complex, the gains in execution speed are well worth the effort. A looped backtest might take hours to run a single backtest, which will be executed in minutes in the vectorized format. In this section, you will backtest a simple moving-average crossover strategy in the vectorized format.
Creating a Basic Backtest
2m 34s
Factors for Setting Exit Signals
5m
Number of Winning and Losing Trades
5m
Reason for High Number of Losing Trades
5m
Advantage of Stop-loss and Profit-take
5m
Implementation of Profit-take and Stop-loss
5m
Conversion of Long-Short to Long-Only Signals
5m
Creation of Vectorized Backtest
5m
Calculate the Moving Average Crossover
5m
Generating Long-Short Trading Signal
5m
Generating Long-Only Trading Signal
5m
Calculate the Cumulative Sum of Returns
5m
Calculation of Portfolio Returns
5m
Additional Reading
Adding Vectorized Stop-loss and Profit-takes
Impact of Profit Take and Stop Loss on Strategy
Designing a Trading System
Asynchronous Computing
Distributed Computing
Importance of Logging and Storage
Hardware Elements of a Trading System
Software Elements of a Trading System
Testing and Version Control
Implementation of a Trading System
Types of Servers
Trading Logic
Testing and Operation
Capstone Project
Run Codes Locally on Your Machine
Summary
Please see the full list of alternative group-buy courses available here: https://lunacourse.com/shop/