*** Proof of Product ***
Exploring the Essential Features of “QuantInsti – Machine Learning for Options Trading”
Machine Learning for Options Trading
Unlock the power of machine learning to take your options trading to the next level! In this course, you will learn how to apply cutting-edge machine learning techniques to trade options strategies and analyse the performance. From model selection to forecasting options prices, implied volatility and even option strategy to trade, you will gain hands-on experience with the tools and techniques used by industry professionals.
LEVEL
Advanced
LIVE TRADING
- Predict the price of options using the features used by options pricing models
- Forecast the direction of the underlying asset using decision tree classifier and backtest an option strategy based on forecast
- Use probability of prediction, random forest model, voting classifier model and blending approach to forecast the prices
- Enter and exit from a short straddle strategy based on the prediction of next day’s implied volatility
- Select the option strategy to trade using a completely automated approach of defining strategy universe, feature creation, training ML model and analysing the performance
SKILLS COVERED
Strategies
- Spread trading with decision trees
- Spread trading with ensemble classifier
- Straddle with implied volatility forecast
- ML predicted options strategy
Concepts & Trading
- Options pricing
- Regression and classification models for options trading
- Volatility forecasting
- Strategy returns prediction
Python
- Pandas, Numpy
- Sklearn
- TensorFLow
- Keras
LEARNING TRACK 5
This course is a part of the Learning Track: Machine Learning & Deep Learning in Trading – II
COURSE FEATURES
Interactive Coding Practice
Capstone Project Using Real Market Data
PREREQUISITES
To start with the course, you need to have a basic understanding of machine learning and options trading. You should also be familiar with options trading related terminologies such as calls, puts, implied volatility, strike price, spot price, payoff, expiry dates, the underlying asset, and futures. Basic knowledge of supervised algorithms such as regression and classification models is required. Hand-on experience with options trading would be an added advantage.
SYLLABUS
Introduction
This course will serve as a step-by-step guide where you will learn to apply cutting-edge machine learning techniques to trade options strategies. The interactive methods used in this course will assist you in not only understanding the concepts but also answering all questions about systematic options trading. This section explains 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
4m 14s
Course Structure
3m 42s
Course Structure Flow Diagram
2m
Quantra Features and Guidance
4m 9s
FAQs and Overview
In this section, we cover frequently asked questions about the course content and provide an overview document that explains the concepts covered in the initial few sections of the course which covers the use of ML to predict stock movement and execute a bull call spread strategy.
Frequently Asked Questions
2m
Part 1: Overview
3m 4s
Vertical Spreads
Vertical spread trading strategies are designed based on the direction-based movement of the underlying asset. This section covers the fundamentals of vertical spreads. Different types of vertical spread trading strategies such as bull call spread, and bear put spread are explained in detail. In addition to this, you will also learn to define the problem statement for the implementation of machine learning algorithms for trading vertical spreads.
Vertical Spreads Options Strategies
2m
Bull Call Spread
2m
Setup Bull Call Spread
2m
Bull Call Spread Payoff
2m
Setup Bear Put Spread
2m
Bear Put Spread Payoff
2m
Market Analysis for Spread Trading
2m
Features to Predict the Underlying
In this section, we will cover topics such as defining predictor and target variables, the calculation and use of historical returns and technical indicators for forecasting the direction of price movements in the SPY ETF. We’ll also explore the importance of stationary data and ML algorithms in the process.
Features to Predict the Underlying
3m 56s
Objective of the Decision Tree Classifier
5m
Benefit of Historical Returns
5m
Use of Technical Indicators
5m
ML Algorithms and Stationary Data
5m
How to Use Jupyter Notebook?
1m 54s
Predictor and Target Variables
5m
Calculate Returns Over Multiple Time Periods
5m
Calculate the NATR
5m
Define the Target Variable
5m
Forecast Direction of Underlying with Decision Tree Classifier
In this section, we will apply the concepts from the previous section to make the predictions. Topics include data splitting, initialising ML parameters, and training the Decision Tree Classifier model. We’ll guide you through the process of initialising and using the decision classifier to predict the direction of the underlying asset’s price movement.
Forecasting Direction of the Underlying with ML
3m
Data Splitting
5m
Evaluating Performance
5m
Parameter max_depth
5m
Decision Tree Classifier to Forecast the Underlying
5m
Initialise the Decision Tree Classifier
5m
Train the Decision Tree Classifier Model
5m
Additional Reading on Forecasting with Decision Tree Classifier
2m
Metrics to Evaluate a Classifier
Learn how to evaluate the performance of a classifier using the classification report and confusion matrix. Understand how to interpret these metrics and use them to study the performance of your ML model.
Evaluating Classifier Model Effectiveness
4m 27s
Accuracy of ML Model
2m
Interpretation of Accuracy
2m
Meaning of Confusion Matrix
2m
Interpreting Confusion Matrix
2m
Predicting Wrong Values
2m
False Positives in Confusion Matrix
2m
Beyond Accuracy
4m 2s
Description of Precision
2m
Predicting Correct Signals
2m
Description of Recall
2m
Calculation of Precision
2m
Calculation of Recall
2m
Calculation of f1 Score
2m
Inference of Performance Metrics
2m
Metrics to Evaluate a Classifier
5m
How to Use Interactive Exercises?
5m
Confusion Matrix
5m
Classification Report
5m
Additional Reading
10m
Test on Forecasting the Underlying with ML
12m
Options Data: Sourcing and Storing
In this section, you will learn about the data that is necessary for options trading. You will also learn how to source and store this data in a pickle file. In the end, you will be provided with a few sources to procure options data as well as the underlying asset’s data.
Options Data
4m 15s
Option Price Data
2m
Data Derived from Options Data
2m
Need for Dividend Data
2m
Need for Underlying Data
2m
Sourcing Options Data
2m
Options Data Storing
5m
EOM Contracts
5m
Python Libraries
5m
Working With Pickle File
5m
Additional Reading on Data Vendors
10m
Options Trading with Decision Trees Classifier
In this section, we will cover how to use predictions of the underlying to deploy the bull call spread strategy. We will also discuss steps to set up the bull call spread using Python, addition of strategy parameters such as stop loss and take profit for better risk management, backtesting the strategy on historical options data and finally, gauging the performance of the strategy by calculating and plotting the cumulative returns.
Strategy Logic for Backtesting Bull Call Spread Strategy
2m
Set Up the Call Spread Strategy
5m
ATM Strike Price
5m
Backtesting Options Spread Strategy
5m
Trade Level Analytics
Analysing certain metrics will help you understand whether your strategy is working. Trade level analytics represents how a strategy has been performing over a given period. In this section, you will be learning how to calculate and interpret a few widely used analytics such as the number of winning trades, number of losing trades, average profit or loss per trade, etc.
Trade Level Analytics I
5m
Trade Level Analytics II
4m 21s
Define Win Trades
2m
Calculate Win/Loss Rate
2m
Calculate Average PnL Per Trade
2m
Identify the Correct Strategy-I
2m
Identify the Correct Strategy-II
2m
Limitations of Win Trade
2m
Calculate Average Trade Duration
2m
Interpret the Profit Factor
2m
Calculate the Profit Factor
2m
Trade Level Analytics of ML Based Spread Trading Strategy
10m
Average PnL Per Trade
5m
Limitations of Profit Factor
2m
Average Trade Duration
5m
Analyse the Strategy Performance
2m
Test on Trading Bull Call Spread with ML
10m
Improving the ML Model
Once the ML model is created, your journey does not stop there. Discover ideas and methods to extract maximum performance from your machine learning model without falling prey to biases.
Improving Your Decision Tree Strategy
3m 3s
Way to Improve ML Model
5m
Methods to Improve ML-model Based Strategy
5m
Role of Probability in Improvement of ML Model
5m
Hyperparameter Tuning and Cross-Validation Methods
In this section, you will discover ways to improve the model by objectively finding the ideal set of hyperparameters. Further, discover ways to tune hyperparameters by splitting the data into multiple mini datasets by using cross-validation
Hyperparameter Tuning
3m 40s
Choice of Best Hyperparameters
5m
Increase of Accuracy and Hyperparameter Tuning
5m
Hyperparameter Tuning with Choice of Range
5m
Knowledge of Range and Hyperparameter Tuning
5m
Total Number of Hyperparameters Combinations
5m
Cross Validation
4m 39s
Usage of Cross-Validation
5m
Reason for Creation of Test Dataset
5m
Steps in Cross-Validation
5m
Order of Time Period in Dataset
5m
Size of Datasets in Cross-Validation
5m
Split Data in Blocked Cross-Validation
5m
Cross-Validation Techniques
5m
Advantage of Blocked Cross-Validation
5m
Additional Reading
2m
Probability Levels For Improving ML Model
Certain ML models predict the final output based on which target class has the highest probability of occurrence. You can set a threshold for the ML model to predict the output for a particular target class, increasing the confidence level on the predictions.
Using Probability Levels For Improving Model
2m
Difference Between Probability and Probability of Occurrence
5m
Correct Usage of Predicting Probability Method
5m
Effect of Probability Levels on Model Performance
5m
Predicted Output After Set Probability Level
5m
Control of Probability Levels in Model
5m
Calculation of Probability of Occurrence
5m
Challenges in Usage of Predicting Probability Method
5m
Implementation of Probability Level in ML Model
5m
Inference of Class Probabilities
5m
Set Probability Level
5m
Additional Reading
2m
Test on Techniques to Improve ML Model Performance
10m
Ensemble Classifiers
Ensemble models typically use more than one ML model to produce the final predicted output. In this section, you will go through different types of ensemble models and their performance.
Random Forest Classifier Model
3m 57s
Need of Random Forest Classifier Model
5m
Inclusion of ML Models in Random Forest Model
5m
Use of Train Data in Random Forest Classifier Model
5m
Reason for Inclusion of Multiple Decision Trees in Random Forest
5m
Voting Classifier Model
2m 57s
Voting Classifier and ML Models
5m
Hard Voting Classifier Model
5m
Soft Voting Classifier Model
5m
Advantage of Voting Classifier Model
5m
Voting Classifier Model
5m
Implement Hard Voting Classifier Model
5m
Implement Soft Voting Classifier Model
5m
Additional Reading
2m
Blending Models
Blending model is a type of ensemble model which consists of using the predicted output of multiple ML models to train a meta model and predicting the final output. You will learn how to build a blending model and analyse its performance.
Blending Machine Learning Models
4m 5s
Limitation of Voting Classifier Model
5m
Naming Convention for Blending Model
5m
Purpose of Meta Model
5m
Need of Predicted Output of Base Model
5m
Improvement in Performance from Blending Model
5m
Initial Step to Blend Machine Learning Model
5m
Training of Base Models
5m
Training of Meta Model
5m
Difference Between Base and Meta Model
5m
Ensemble Model for Prediction
5m
Comparison of Base and Meta Model’s Performance
5m
Disadvantage of Meta Model
5m
Blending of Machine Learning Models
5m
Usage of Blender Model for Prediction
5m
Test on Ensemble Models
10m
Parametric Vs Nonparametric Models
After completing this section you will be able to define parametric and nonparametric models. You will also be able to differentiate between the two and understand which of the two models is better when it comes to predicting options prices.
Parametric and Nonparametric Models
4m 6s
Parametric and Nonparametric Model Characteristics
5m
Machine Learning Models
5m
Nonparametric Model
5m
Options Pricing Model
5m
Additional Reading on Parametric and Nonparametric Models
2m
Options Pricing: Feature Engineering
In this section, we will discuss a few input parameters used for predicting options prices and find out where you can get them. You will also learn how to manipulate and transform the sourced data which will then be used to train a model.
Features for Options Pricing
3m 42s
Target Variable
5m
Moneyness
5m
Years to expiry
5m
Size of the dataset
5m
Input Features
5m
Features for Options Pricing
5m
Moneyness
5m
Merge the Data
5m
ML for Options Pricing
With all the assumptions of parametric models such as the Black-Scholes model, have you ever thought about how an ML model can be used to predict options? In this section, we will take you through the process of predicting options prices using regression models such as Artificial Neural Network, Decision Trees, Random Forest, and Lasso. We will also create a function which can be used to predict prices using any of the models mentioned here. Finally, we will plot and compare the prediction error of these models for all contracts on the basis of moneyness.
Predicting Options Prices
2m
Hidden Layers
5m
Shuffle the Data
5m
Activation Function
5m
Predicting Options Prices
5m
Split the Data
5m
Compute the Prediction Error
5m
Interpret the Plot
5m
Polyfit
5m
Options Pricing with Multiple Models
5m
Prediction Error
5m
Plot for Multiple Models
5m
Additional Reading on Options Pricing
2m
Test on Options Pricing
10m
Implied Volatility Concepts
Certain strategies profit from fluctuations in the underlying security. And, for these strategies, forecasting the degree of movement based on market participants’ expectations becomes important. You will learn about implied volatility and how to calculate it in this section.
Implied Volatility
1m 28s
Measurement of Volatility
2m
Implied Volatility Inference
2m
Properties of Implied Volatility
2m
Additional Reading for Black-Scholes Model
2m
Additional Reading for Implied Volatility
2m
Implied Volatility Calculation
5m
Calculate Implied Volatility
5m
Forecasting Implied Volatility
You have learned about the concept of implied volatility. To make it more interesting let us apply some machine learning concepts that we have learned previously to forecast the implied volatility values.
Forecasting Implied Volatility
5m 24s
Model Creation Process
5m
Non-Stationary Features
5m
Data Quality Issue
5m
Data Preprocessing
5m
Call LTP
5m
Machine Learning Models
5m
Additional Reading for Random Forest Model
2m
Forecasting IV
5m
Actual Vs Predicted IV Graph
5m
Feature Engineering
5m
Calculate the ADX indicator
5m
Trading Options Using Forecasted IV Values
You have predicted the IV values in the previous section. Let us now backtest an options strategy that takes trades based on the predicted IV values.
Backtesting Short Straddle
2m 12s
Market Conditions
5m
Risk Management
5m
Backtest Short Straddle Strategy
5m
Exit Price
5m
Exit Conditions – Short Straddle
5m
Entry Condition
5m
Exit Condition
5m
Limitations – Forecasted IV Values
5m
Test on Trading Implied Volatility
10m
Need for ML to Predict Option Strategy to Trade
There are plenty of options strategies such as straddle, strangle, bull call spread and iron condor. In this section, we will learn why you should use ML model to determine which strategy to trade on any given day.
Need of ML for Strategy Prediction
1m 37s
Need for Application of Machine Learning
5m
Selection of an Options Strategy
5m
Defining the Best Option Strategy to Trade
In this section, we will define a problem statement to create a machine learning model for predicting the best options strategy to deploy on the next trading day. This section also covers the process of creating the target variable for the problem statement.
Creating the Target Variable
3m 18s
Creating the Target Variable – Strategy Design
5m
Target Variable for the ML Model
5m
List of Strategies
5m
Create the Combinations of Positions
5m
Filter the Strategies – 1
5m
Filter the Strategies – 2
5m
Creating the Target Variable Using Strategy Returns
5m
Input Features for Predicting the Best Options Strategy
Creating relevant input features is an important step in approaching a problem using machine learning. In this section, we will create input features for the problem statement of creating a machine learning model to predict the options strategy to deploy.
Selecting The Input Features
1m 46s
Input Features for the Machine Learning Model
5m
Input Features of Underlying Assets
5m
Options Greeks as Features
5m
Creating the Input Features
5m
Feature to Study Momentum of the Underlying
5m
Feature to Study Volatility of the Underlying
5m
Normalise the Upper Bollinger Band
5m
Model Design and Backtesting the Performance
This section covers the process of selecting the suitable machine learning model for predicting the best options strategy to deploy. You will learn to apply deep learning by designing a Long Short-Term Memory (LSTM) artificial neural network using the input features and target variable defined in the previous section. In addition to this, you will also learn to backtest the signals generated by the LSTM model and analyse the performance of trades taken based on the signals generated.
Selecting the ML Model to Deploy
2m 2s
Multi-Class Classification Problems
5m
Learning Rate for LSTM
5m
Machine Learning Model Design
5m
Backtest the Predicted Strategies
5m
Trade Level Analytics of Predicted Strategies
5m
Strategy Analytics of Predicted Strategies
5m
Test on ML Model to Predict Strategy
14m
Challenges in Live Trading
This section talks about the challenges faced during saving the model and data, and retraining the model. It demonstrates the simulation of trading using machine learning model.
Live Trading Challenges
5m 50s
Pickle Parameter
2m
Dump Command
2m
Serialization
2m
Save The Model
2m
Save The Data
2m
Challenges In Retraining The Model
3m 25s
Retrain A Model
2m
How To Perform Simulation
3m 47s
Simulation Of Trading
2m
Data Leakage
2m
Save Train and Simulate ML Model
5m
Run Codes Locally on Your Machine
In this section, you will learn to install the Python environment on your local machine. You will also learn about some common problems while installing python and how to troubleshoot them.
Python Installation Overview
2m 18s
Flow Diagram
10m
Install Anaconda on Windows
10m
Install Anaconda on Mac
10m
Know your Current Environment
2m
Troubleshooting Anaconda Installation Problems
10m
Creating a Python Environment
10m
Changing Environments
2m
Quantra Environment
2m
Troubleshooting Tips for Setting Up Environment
10m
How to Run Files in Downloadable Section?
10m
Troubleshooting for Running Files in Downloadable Section
10m
Capstone Project
In this section, you will apply the knowledge you have gained in the course. You will pick up a capstone project where you will create a machine learning model that predicts the probability of returns (positive/negative) of an options trading strategy for the next trading day.
Getting Started
2m
Problem Statement
2m
Code Template and Data Files
2m
Capstone Project Model Solution
5m
Capstone Solution Downloadable
2m
Live Trading on IBridgePy
In this section, you would go through the different processes and API methods to build your own trading strategy for the live markets, and take it live as well.
Section Overview
2m 2s
Live Trading Overview
2m 41s
Vectorised vs Event Driven
2m
Process in Live Trading
2m
Real-Time Data Source
2m
Code Structure
2m 15s
API Methods
10m
Schedule Strategy Logic
2m
Fetch Historical Data
2m
Place Orders
2m
IBridgePy Course Link
10m
Additional Reading
10m
Frequently Asked Questions
10m
Paper and Live Trading
To make sure that you can use your learning from the course in the live markets, a live trading template has been created which can be used to paper trade and analyse its performance. This template can be used as a starting point to create your very own unique trading strategy.
Template Documentation
10m
Template Code File
2m
Additional Applications of ML for Options Trading
So far, you have learnt that machine learning models can be used to price the options, predict the underlying asset, forecast the implied volatility, and also to predict the options strategy to deploy. In this section you will learn the additional applications of machine learning for options trading.
Further Applications of ML for Options Trading
2m
Applications of ML for Options Trading
5m
Sentiment Data for Options Trading
5m
Summary
In this section, we will summarise all the concepts that you’ve learnt throughout the course. You will also find a zip file containing all the notebooks and data files used in the course.
Course Summary
4m 17s
Summary and Next Steps
2m
Python Codes and Data
2m
ABOUT AUTHOR
QuantInsti®
QuantInsti is the world’s leading algorithmic and quantitative trading research & training institute with registered users in 190+ countries and territories. An initiative by founders of iRage, one of India’s top HFT firms, QuantInsti has been helping its users grow in this domain through its learning & financial applications based ecosystem for 10+ years.
WHY QUANTRA®?
Gain more in less time
Get taught by practitioners
Learn at your own pace
Get data & strategy models to practice on your own
Please see the full list of alternative group-buy courses available here: https://lunacourse.com/shop/