Learning Track: Artificial Intelligence in Trading Advanced
₹49080/-₹61350/-
75% OFF
+ Additional 20% OFF
- Live Trading
- Learning Track
- Prerequisites
- Syllabus
- About author
- Testimonials
- Faqs
Apply AI in Trading

Skills Covered
Machine Learning
- Double Q-learning and ANN
- RNN and LSTM
- XGBoost Model
- Word Embedding Models
- K-Means and DBSCAN Clustering
Math & Core Concepts
- Stochastic gradient descent
- Loss Function
- Sigmoid Function
- Cross Entropy
- Euclidean distance, WCSS
Python Libraries
- Pandas, Numpy, Matplotlib
- TA-lib, Sklearn, Keras
- R2scorer, Accuracy_score
- Tensorflow, XGBoost
- CountVectorizer

learning track 5
Artificial Intelligence in Trading Advanced
Full Learning Track
These courses are specially curated to help you with end-to-end learning of the subject.
Course Features
- Community
Faculty Support on Community
- Interactive Coding Exercises
Interactive Coding Practice
- Capstone Project
Capstone Project using Real Market Data
- Trade & Learn Together
Trade and Learn Together
- Get Certified
Get Certified
Prerequisites
You should have a basic knowledge of machine learning algorithms and options trading. These concepts are covered in our free courses 'Introduction to Machine Learning' and 'Options Trading Strategies In Python: Basic'. Prior experience in programming is required to fully understand the implementation of advanced AI trading algorithms covered in the course. If you want to be able to code and implement machine learning strategies in Python, you should be able to work with 'Dataframes' and the 'Sklearn' library. Some of these skills are covered in the course 'Python for Trading: Basic'.
Syllabus
- Introduction to the CourseGet an overview of the natural language processing in trading, the course structure and how you can get maximum out of this course.
- Applications of Natural Language ProcessingExplore the application of natural language processing such as machine translation, automatic summarization, sentiment analysis, text classification, and question answering.Applications of NLP3m 2sQuestion-Answer Analytics2mFeatures of Sentiment Analysis2mMachine Translation2m
- Sources of News Headline DataWork with code to get the latest and most relevant news headlines, use the acquired data for back-testing, and forecast stock and bond prices.News Headline Data2m 36sHow to Use Jupyter Notebook?2m 5sSources of News Headline Data10mFrequency of News Headlines5m
Sentiment Score and Strategy Logic
Learn to aggregate the sentiment score from multiple news headlines and to select the right news headlines. This score forms the basic building block for creating a strategy.Sentiment Strategy on Stocks
Calculate daily stock returns, define the trading rules, backtest and plot the strategy returns.- Sentiment Strategy on BondsReturns from the corporate bonds are impacted by the movement from corporate bond index and treasuries. Learn to calculate the corporate bond returns from the spread and create a trading strategy, backtest and plot the strategy returns.Predict Bond Returns2m 12sBond Yield and Prices2mSentiment Study2mHow to Calculate Bond Returns?10mDaily Change of Option-Adjusted Spread5mCalculate Bond Returns5mOption Adjusted Spread2mSentiment Strategy on Bonds10mSignal Calculation from Sentiment5mFormula to Calculate Bond Returns2mCalculate Strategy Returns5mTest on Sentiment Trading Strategy14m
- Introduction to Word EmbeddingsComputers are good with numbers! Learn basic building blocks of converting textual data to numbers and its importance in sentiment analysis.Word Embedding Approaches1m 38sWord Embeddings2mApplications of Embedding Models2mWord Embedding Methods2mNumerical Representation of Word2m
Bag of Words
Explore one of the first word embedding technique: Bag of Words model. Calculate the bag of words vector from a list of sentences.Bag of Words1m 41sPrimary Function of Bag of Words2mBag of Words Table2mHow to Calculate Bag of Words2mBag of Words Calculation10mInitialise Count Vectoriser5mApply Fit Transform5mGet Unique words5mBag of Words to Numpy Array5m- Predicting Sentiment Score Using XGBoostLearn to train a machine learning model to predict the sentiment class from the historical news headline vector data. Familiarise with the relative advantages and limitations of XGBoost with respect to neural networks.Predict Sentiment Score Using XGBoost Model2m 9sXGBoost Model2mMechanism Followed by XGBoost2mBoW to XGBoost10mCreate Bag-of-Words on the Test Set5mInitialise XGBoost Classifier5mFit XGBoost Model5mPredict using Test Set5mCalculate Accuracy of Strategy5m
- Sentiment Class of News HeadlinesIn this section, you will learn how to calculate the sentiment class of the new news headlines data.Calculate Sentiment Class of News Headlines10mSteps to Calculate Sentiment Class2mAccuracy of the Model2m
- TF-IDFExplore the usefulness, characteristics and significance of TF-IDF. List the limitations of Bag of Words model. And learn to code and calculate the TF-IDF score and predict the sentiment class.TF-IDF9sHow to Calculate IDF?2mCharacteristics of TF-IDF2mCalculate TF-IDF Score of a Word2mSignificance of TF-IDF2mTF-IDF Calculation10mIDF of a Single Word5mInitialise the TfidfTransformer Object5mIDF for All Words5mCalculate Word Frequencies to TF-IDF5mConvert Corpus Directly to TF-IDF Score5mTF-IDF to XGBoost10mInitialise TfidfVectorizer Object5m
- WordVecWord2Vec is an advanced model compared to the previous models. It can identify similar words from its usage in a sentence. Train a Word2Vec model from scratch, load Google's pre-trained model and harness its power to train and predict sentiment class from news headlines.Limitations of BoW and TF-IDF10mCharacteristics of BoW Method2mWord2Vec2m 2sWord2Vec Method2mOvercome Limitations of BoW and TF-IDF10mWord2Vec Model2mWord2Vec Basic Implementation10mWord2Vec Generation Method2mCreate Tokens5mWord2Vec Using Google Model10mCreate Word2Vec Model5mLimitations of Word2Vec Method2m 4sLimitations of Word2Vec2mBetter Word Embedding Methods2mWord2Vec to XGBoost10m
- BERTWords are given importance based on the context in which they are used. This approach makes the accuracy of BERT model very high. Explore the workings of BERT model. And how to code and implement it in Python to predict the sentiment class.BERT Model Explanation10mBERT Model2mBERT Processing2mBERT Setup10mImplementation of BERT Model10mBERT to XGBoost10mAdditional Reading10mBERT Implementation in Google Colaboratory2mTest on BoW, TF-IDF, Word2Vec, and BERT14m
- BERT Model AdaptationBERT models can be adapted based on applications such as financial markets. Learn the fine tuning of the BERT model that can improve the sentiment prediction.Improve BERT Model: BERT Model Adaptation10mBERT Model2mBERT Model Adaptation2m
- Result AnalysisCompare different word embedding methods with their advantages and disadvantages.Comparison of Different Word Embedding Method10mAdvantages of BERT Model2mDifference Between WordVec and TF-IDF2mTest on BERT Improvement and Result Analysis10m
- Run Codes Locally on Your MachineLearn to install the Python environment in your local machine.Uninterrupted Learning Journey with Quantra2mPython Installation Overview1m 59sFlow Diagram10mInstall Anaconda on Windows10mInstall Anaconda on Mac10mKnow your Current Environment2mTroubleshooting Anaconda Installation Problems10mCreating a Python Environment10mChanging Environments2mQuantra Environment2mTroubleshooting Tips For Setting Up Environment10mHow to Run Files in Downloadable Section?10mTroubleshooting For Running Files in Downloadable Section10m
- Live Trading on IBridgePySection Overview2m 2sLive Trading Overview2m 41sVectorised vs Event Driven2mProcess in Live Trading2mReal-Time Data Source2mCode Structure2m 15sAPI Methods10mSchedule Strategy Logic2mFetch Historical Data2mPlace Orders2mIBridgePy Course Link10mAdditional Reading10mFrequently Asked Questions10m
- Paper and Live TradingIn this section, a live trading strategy template will be provided to you. You can tweak the strategy template to deploy your strategies in the live market!Recent News Headline Data10mAdditional Reading10mTemplate Documentation10mTemplate Code File2m
- Capstone ProjectIn this section, you will undertake a capstone project to predict the sentiment of the new news headlines data using the XGBoost model. This project helps you to practice and apply the concepts learnt in this course.Capstone Project: Getting Started10mProblem Statement10mFrequently Asked Questions10mCode Template and Data Files2mModel Solution10mCapstone Solution Downloadable2m
- Course SummaryThis section includes a downloadable zipped folder with all the codes and notebooks for easy access.Summary1m 52sPython Codes and Data2m
- Introduction to the CourseUnsupervised learning has the ability to uncover hidden patterns in the dataset and can provide unique insights in your data. In this section, you will acquaint yourself with the course structure, and the various teaching tools used in the course: videos, quizzes, and strategy codes. The interactive methods used help you to not only understand the concepts, but also how to implement the strategies.Course Introduction4m 29sCourse Structure3m 15sCourse Structure Flow Diagram10mQuantra Features and Guidance4m 9s
Introduction to Unsupervised Learning
Unsupervised learning can be applied when you are not sure about the end outcome that you are looking for. It can be used to divide the data in smaller groups when the labels are not available. This section will give you an overview of what unsupervised learning is along with an insight into one of its applications, dimensionality reduction.Introduction to Unsupervised Learning2m 43sNeed for Unsupervised Learning I2mNeed for Unsupervised Learning II2mAn Application of Unsupervised Learning2m 56sDimensionality Reduction2mFeatures after Dimensionality Reduction2mNeed for Dimensionality Reduction2mFacts about Unsupervised Learning2m- ClusteringClustering is a technique to divide the data into smaller groups with similar data points called clusters. This section explains how the outputs are generated in clustering. You will also understand how clustering is different from classification.Clustering2m 48sWhat is Clustering?2mCriteria for Grouping2mNumber of Data Points in a Cluster2mOutput of Clustering Algorithm2mProperties of a Cluster1m 45sOptimal Cluster2mProperties of a Cluster2mClassification Vs Clustering2mLabels in the Dataset2mAim of Clustering2mSelect the Algorithm I2mSelect the Algorithm II2mLimitations of Clustering2m
K-Means Clustering
You will be introduced to your very first clustering algorithm, the k-means. You will take a deep dive into how k-means works by developing an intuitive as well as a mathematical understanding on how the algorithm finds hidden patterns in the data.What is K-Means Clustering?3m 29sOptimised Centroid2mPoints in a Cluster2mMathematics behind K-Means Clustering5m 22sEuclidean Distance2mChoosing the Cluster2mMean Distance2mAdditional Reading10m- K-Means for Financial DataThis section will introduce you to the application of k-means on financial data. You will find hidden patterns on the price series for Apple stock using the relative strength index and the average directional index. The implementation for this will be carried out in Python.K-Means on Financial Data2m 31sNumber of Clusters2mFeatures2mWrong Clusters2mDistance from Centroid2mUsing Jupyter Notebook1m 54sApplying K-Means to Create Clusters10mCalculate Percentage Change5mCalculate Volatility5mInitialise K-Means5mFit and Predict the Model5mAdditional Reading10m
Scaling the Data
You want to introduce multiple features to your model, say for instance, RSI, ADX and volatility. Can you directly pass the features to the model? The model won’t appreciate that! This section will introduce you to the importance of scaling your data before passing it to the k-means model.Scaling the Data2m 33sDistance Problem2mScaling Requirement2mRange for Min-Max Scaling2mSubtraction in Min-Max Scaling2mMin-Max Scaling Calculation2mScaled Clusters2mScaling Technique5mScaling the Data10mMin-Max Scaler5mAdditional Reading10mFeature Selection
Remember the time you used simple moving averages, bollinger bands, MACD and 5 other indicators to take that trade? This feature selection section will introduce and guide you in selecting your input features and what features are considered good.Feature Selection3m 6sSelecting Features2mAppropriate Features2mStationary Series2mCorrelated Series2mCorrelated Features2mChoosing Threshold Value2mDiscarding Features2mFeature Selection10mCalculate Test Statistic5mADF test2mCreate a Correlation Matrix5mPairs Above the Threshold Correlation Value5mDrop Columns5mAdditional Reading10mSelecting Clusters for K-Means
K-means asks you to pass the number of groups you would like to discover with unique hidden patterns. You can find eight groups or ten groups or any number as per your choice. The section answers the question whether there is an optimal number of groups that can be created.Choosing the Number of Clusters4m 20sCalculate WCSS for 2 Clusters2mPenalising in WCSS2mMinimise WCSS - I2mMinimise WCSS - II2mChange in WCSS2mOptimum Clusters2mSteps in WCSS2mChoosing the Number of Clusters10mCalculate WCSS5mWCSS for Multiple Cluster Numbers5mAdditional Reading10m- Analysing Clusters: Hit RatioYou have identified the hidden patterns and created the clusters. What do you do next? You generate trading signals! You will learn to create the very first trading strategy using the k-means algorithm and perform a comprehensive backtest.Cluster Analysis with Hit Ratio2mTrading Signals2mAverage Future Returns2mFuture Returns2mThreshold Value for Hit Ratio2mTrain-Test Split2mCluster Analysis with Hit Ratio10mStrategy Analytics for Hit Ratio10mCreating Train and Test Dataset5mAnalytics for a Single Cluster5mCalculating Hit Ratio5mMap Clusters to Trading Signals5mStrategy Returns5mForecast the Cluster2mMap the Trading Signal2mAdditional Reading10m
- Analysing Clusters: SkewnessCould there be an alternative approach to creating a trading strategy with k-means? This section will walk you through your second strategy using skewness. The strategy will aim to capture the tail events in Apple.Cluster Analysis with Skewness4m 40sWhy Skewness?2mCalculate Skewness2mDirection Based on Skewness2mSkewed Distributions2mCluster Analysis with Skewness10mCalculating Skewness with Python5mPlot Returns Distribution5mTrade Direction2mAdditional Reading10m
Putting It All Together
This section will put together all of your learnings from the previous sections. You will have a workflow that you can follow to develop any trading strategy using k-means for any asset class.Strategising with K-Means1m 59sSequence of Steps2mPutting It All Together10mAdditional Reading10mCurse of Dimensionality
Does adding more data equal more information and ultimately offer more insights? In this section, you will realise that this isn’t entirely true. You will also go about learning different ways to reduce the dataset features effectively.Impact of Adding Features to Clustering2m 35sDefinition of Curse of Dimensionality2mRelation Between Features and Distance Between Points2mIssue With Cluster Equal to Data Points2mOvercoming Curse of Dimensionality2m 5sCriteria for Eliminating Features2mComparing Features for Elimination2mRelation Between Features2mAdditional Reading10mIntroduction to Principal Component Analysis
Reducing features while minimising information loss is the ace up the sleeve of principal component analysis (PCA). You will see how PCA reduces dimensions and still keeps most of the information content.Principal Component Analysis3m 7sReducing Dimensions by Finding Best Line2mMaximum Limit of PCA Algorithm2mChoosing the Best Line2mPCA and Information Loss2mMathematical Explanation of PCA2m 22sMatrix Multiplication2mPreservation of Maximum Information2mFeatures and Eigenvalues2mVariance and Covariance10mInterpretation of Variance2mCalculate the Covariance Matrix5mVariance of ADX2mCovariance of ADX and EMA2mHigh Covariance2mAdditional Reading10mMaths Behind Principal Component Analysis
In this section, you will get under the hood of the principal component analysis and see how it uses eigenvalues and eigenvectors to reduce the dimensions effectively. You will also work on a data sample and see it in action.Basics of Matrices and Eigenvalues3m 14sDefinition of Variance Matrix2mProperties of an Identity Matrix2mLambda and Eigenvectors2mDeterminant of a Matrix2mSignificance of Eigenvalues2mDimensions and Eigenvalues2mEigenvectors2m 53sMaximum Variance and Eigenvalues2mSelection of Eigenvalues2mEigenvalues and Explained Variance2mSelecting the Correct Eigenvalue2mTransforming Dimensions Using Eigenvectors2mMaths Behind PCA10mFirst Principal Component2mCalculate the Eigenvectors5mPCA Example10mProject the Data-points in 1 Dimension5mCalculate the Principal Components5mAdditional Reading10mPrincipal Component Analysis
Principal components help us in dimensionality reduction. You will work on a dataset and figure out how you can choose the number of principal components, depending on the threshold of the information contained in the dataset you would like to keep.Choosing Number of Principal Components4m 17sPercentage of Principal Components2mOptimum Number of Principal Components2mChoosing the Number of Features in PCA10mExplain 80% of the Variance5mExplained Variance Vs Number of Features2mAdditional Reading10m- Application of Unsupervised Learning for Pairs TradingIn simple terms, pairs trading implies that you select a pair of stocks for trading, where you go long on one and short the other. This is a market neutral trading strategy. In this section, you will see how unsupervised learning can help you identify pairs from a large number of stocks dataset.Application of Unsupervised Learning for Pairs Trading10mSelection of Pairs From Cluster2mSteps to Find Pairs2mDefinition of Pairs Trading2mTest of Stationarity2mPairs Using Unsupervised Learning2mFeature Selection for Pairs2mFeature Engineering for Pairs Trading5mGood Features2mNeed to Apply PCA2mNeed to Standardise the Data2mStandardise the Data5mCreating Clusters2m
DBSCAN
DBSCAN is a density-based clustering technique that deals with the noise in the dataset. You will create and visualise clusters on a toy dataset using the DBSCAN algorithm in this section. You will also see how this technique is different from k-means clustering.Intuition of Density-Based Clustering3m 54sParameters of DBSCAN2mIdentify the Core Point2mIdentify the Noise2mNumber of Boundary Points2mNumber of Points in Neighbourhood2mClusters using DBSCAN2mLimitations of DBSCAN2mK-Means Vs DBSCAN10mCreate Clusters Using DBSCAN5mSelecting the Parameters for DBSCAN10mAdditional Reading10m- Pairs Trading using Clustering AlgorithmsIn this section, you will continue to work on creating pairs of stocks for pairs trading strategy. You will apply DBSCAN on the reduced data to create clusters. From the clusters, you will select pairs of stock and test for cointegration.Create Pairs using DBSCAN10mReduce Data for Visualisation Using TSNE5mThe Grey Points2mSelect and View Stocks in a Cluster5mNumber of Pairs2mForm Pairs from a Cluster5mCointegration Test10mCreate the Portfolio5mTest for Cointegration5mADF Test2mAdditional Reading10m
- Run Codes Locally on Your MachineLearn to install the Python environment in your local machine.Uninterrupted Learning Journey with Quantra2mPython Installation Overview1m 59sFlow Diagram10mInstall Anaconda on Windows10mInstall Anaconda on Mac10mKnow your Current Environment2mTroubleshooting Anaconda Installation Problems10mCreating a Python Environment10mChanging Environments2mQuantra Environment2mTroubleshooting Tips For Setting Up Environment10mHow to Run Files in Downloadable Section?10mTroubleshooting For Running Files in Downloadable Section10m
- Capstone ProjectIn this section, you will undertake a capstone project where you apply the k-means algorithm on the stock of your choice. This project helps you to practice and apply the concepts learnt in this course.Capstone Project: Getting Started10mProblem Statement10mFrequently Asked Questions10mCode Template and Data Files2mCapstone Project Model Solution10mCapstone Solution Downloadable2m
- Automate Trading Strategy Using IBridgePyThe section will provide you with a ready-made template that can be used for live trading after tweaking the parameters to your discretion.Additional Reading10mSample Strategy to Run on Interactive Brokers2m
- Course SummaryIn this section, you will go through the different concepts you learnt throughout the course. You will also be able to download all the strategy notebooks as a zip file. You can use these notebooks and modify their contents to create your own unique strategy.Course Summary3m 50sPython Data and Codes2m
- Neural NetworksThis section introduces simple neural networks along with its working and how it can be used in prediction problems. It covers important concepts like forward and back propagation and shows how to create a neural network model in Python.Introduction3m 54sQuantra Features and Guidance3m 48sNeural Networks Intuition1m 55sLinear Regression Revisited3mHidden Layers2mStructure of a Neural Network2mUnderstanding Forward Propagation10mForward Propagation Mechanism2mBackpropagation2m 56sCalculate the MSE2mIdentify Loss Functions2mLoss Optimisation2mIdentify Optimisation Method2mFunction Derivative Chain Rule10mIdentify Derivative Equation2mMath behind Back-Propagation10mImplement a MLPClassifier2m 26sIdentify the Sigmoid Graph2mOutput of a Sigmoid Function2mHow to Use Jupyter Notebook?1m 54sMLPClassifier Hands-on10mImport Boeing Co Data5mDefine Predictor Variable5mCalculate Future Returns5mDefine Target Variable5mTrain-Test Split5mFeature Scaling5mLoss Optimisation Algorithm2mWhat is Sigmoid?2mHidden Layer Sizes2mMLPClassifier Definition5mPredict Market Movement5mGenerate Evaluation Metrics2mTest on Neural Networks12m
- Live Trading on BlueshiftThis section will walk you through the steps involved in taking your trading strategy live. You will learn about backtesting and live trading platform, Blueshift. You will learn about code structure, various functions used to create a strategy and finally, paper or live trade on Blueshift.Uninterrupted Learning Journey with Quantra2mSection Overview2m 19sLive Trading Overview2mVectorised vs Event Driven2mProcess in Live Trading2mReal-Time Data Source2mBlueshift Code Structure2m 57sImportant API Methods10mSchedule Strategy Logic2mFetch Historical Data2mPlace Orders2mBacktest and Live Trade on Blueshift4m 5sAdditional Reading10mBlueshift Data FAQs10m
- Live Trading TemplateBlueshift Live Trading TemplatePaper/Live Trading MLP Classifier Strategy10mFAQs for Live Trading on Blueshift10m
Deep Learning in Trading
This section explains the concept of deep learning and its implementation using Keras. It demonstrates how to create a deep neural network in Python to predict future prices of a trading instrument.Introduction to Deep Learning3m 43sTypes of Network Layers2mActivation Function Primer5mIdentify the Missing Activation2mUse the Appropriate Activation2mDNN Model Training3m 42sWhat is an Optimizer?2mCross Entropy Primer10mCross Entropy Calculation2mDNN Trading Strategy Birdeye2m 18sDNN Trading Strategy Code10mInstall Keras With Tensorflow10mMinmaxscaler for OHLC?2mScaling OHLC Prices5mWhy do we Reshape?2mCreating OHLC features5mStandard Scaler vs Min-Max Scaler2mCreate Target Variable5mSplitting of Dataset5mCalculate Class Frequency2mCalculate Class Percentage5mImporting Sequential2mWhy Keras ModelCheckpoint?2mDid You Install It?2mAdding a Dense Layer5mAdding Activation to Dense5mAdding Dropout to Dense5mWhy use ModelCheckpoint?2mWhy use validation_split Attribute?2mInterpret Loss Function2mCode Comprehension2mCalculating Sharpe Ratio5mStrategy vs Market Return2mNormalising Data10mTest on Deep Learning12m- Recurrent Neural NetworksThis section introduces the topic of recurrent neural networks and explains its working with time series data. It also provides a Python code to implement the RNN model to predict prices.RNNs in Time Series Analysis5m 3sDo you know RNNs?2mWhat are the inputs to an RNN?2mHidden State as Input2mPredicting Prices using RNN10mStrategy Analytics for RNN10mCode Comprehension2mKeras RNN Syntax2mWhat is MSE?2mInput to an RNN Model2mAdd a simple RNN layer5mNot an RNN parameter2mVisualise the Model5mSaving the Predictions5mData Transformation2mCalculating the Spread5mTest on Recurrent Neural Networks12m
- Long Short Term Memory Unit (LSTMs)This section discusses the LSTM technique and how it helps in overcoming the shortcomings of RNN. It also shows the implementation of LSTM based strategy in Python.Vanishing and Exploding Gradients2m 30sGradients2mReasons for Gradient Vanishing2mPreventing Exploding Gradients2mLong Short Term Memory Unit5m 49sForget Valve Activation2mInputs to an LSTM cell2mWhat Goes In?2mMemory Gate2mLSTM based trading strategy3m 31sParameters of an LSTM layer2mAssumption2mSpread2mLSTM based Strategy10mUnderstanding the Code2mFeature and Target Datasets10m3-D Array2mAdd Three Layers10mOrder of Layers2mTest on Long Short Term Memory Unit14m
- Cross Validation in KerasIn this section, you will learn about hyper-parameter tuning and cross-validation to optimise your quantitative trading strategy.Hyper Parameter Tuning Using Cross Validation4m 23sK- Fold Cross Validation2mGridSearch2mTrading Strategy using Cross Validation10mKerasClassifier2mCode a KerasClassifier5mWhat does KerasClassifier do?2mCreating the Grid Object10mParameters of GridSearch2mCreate the Best Model5mBest Params for the Model2mHyperparameters in a DNN model2m 32sEarly Stopping Hyperparameter10mHyperparameters in a RNN model2mImportant Hyperparameters10mTest on Cross Validation in Keras10m
Challenges in Live Trading
This section discusses how to handle the challenges faced while saving the model and data and retraining the model. It also demonstrates the simulation of trading using deep learning and provides downloadable resources at the end of the course.Challenges in Saving Model and Data5m 36sJSON parameter2mDump Command2mSave the Model2mSave the Data2mChallenges in Retraining the Model3m 19sRetrain a Model2mHow to perform Simulation4m 28sSimulation of Trading2mData Leakage2mTrading Simulation using Deep Learning10mCourse Summary2m 42s- Run Codes Locally on Your MachineLearn to install the Python environment in your local machine.Python Installation Overview2m 18sFlow Diagram10mInstall Anaconda on Windows10mInstall Anaconda on Mac10mKnow your Current Environment2mTroubleshooting Anaconda Installation Problems10mCreating a Python Environment10mChanging Environments2mQuantra Environment2mTroubleshooting Tips For Setting Up Environment10mHow to Run Files in Downloadable Section?10mTroubleshooting For Running Files in Downloadable Section10m
- Paper and Live TradingIn this section, a live trading strategy template will be provided to you. You can tweak the strategy template to deploy your strategies in the live market!Template Documentation10mTemplate Code FileTest on Live Trading10m
- Downloadable ResourcesYou can download the Python strategy codes at the end of the course.Python Codes and Data2m
- IntroductionLearn applications and effectiveness of using RL models in trading. The course has utilised 100+ research papers, articles to create the RL model which went through hundreds of iterations on known synthetic patterns to finalise hyperparameters, Q-learning, experience replay and feedforward network. You would learn to create a full RL framework from scratch and practice in the capstone project. At the end of the course, you will learn to implement the model in live trading.
Need for Reinforcement Learning
Delayed gratification says that foregoing a reward in the short term might lead to a greater reward in the long term. Designing a normal decision-making algorithm to address delayed gratification is difficult. Selecting an action favouring no reward immediately but a possible future reward is problematic for the algorithm. Learn how reinforcement learning tackles delayed gratification by assigning immediate rewards in the short term to maximise our long term reward.Introduction to Reinforcement Learning1m 52sDilemma of Decision making2mDesign Algorithm for Promotion2mFactors in Trading2mImpact of Decision2mDecision Problem and Trading2mDelayed Gratification2m 39sReward Based on Delayed Gratification2mReward Based on Time2mDesigning Delayed Gratification Algorithm2mDelayed Gratification Using RL2mTest on Needs of RL14m- State, Actions and RewardsIn this section, you will learn about states, actions and rewards. These are the basic building blocks of a reinforcement learning model. A state gives us a view of our environment, which can include price data, technical indicators as well as trend identifications. You will learn how a reward function is designed to help us maximise our rewards. This helps in analysing the environment and choosing the right actions.States, Actions and Rewards2m 40sDefinition of State2mWhat Can Be Added in State2mNeed for Reward2mIdentifying the Reward2mActions in Reinforcement Learning2mDefining Action for Self Driving Car2mLimitation of Profit as Reward2mReward Function Design1m 34sPoorly Designed Reward Function2mMetrics of Reward System2mNext Step in Reinforcement Learning2m
- Q LearningIn this section, you will be introduced to the Q table, which is used for calculating the immediate rewards. Further, you will learn about the role of neural networks in calculating the q-values. These values are used to select the actions which will maximise our rewards.Creating the Q Table2m 55sRequirement of Q Table2mDifference between Q and R Table2mRepresentation of Q Table2mIdentifying the Bellman Equation2mImportance of the Bellman Equation2mUpdating the Q Table2mSolving the Bellman Equation2mFinding Q Table Value2mZero Learning Rate Impact2mHigh Learning Rate2mTraditional vs Deep RL2mAction Based on Q Value2mDQN and Experience Replay2m 27sI/O of NN2mDefinition of Experience Replay2mAdditional Reading10m
- State ConstructionIn this section, you will learn about the input features used in the construction of a state. You will understand why an input feature should be weakly predictive and stationary.State Construction1m 59sRaw Price Data as Input Feature2mProperties of Input Features2mCharacteristics of Input Features2mReturns From Price Series2mTechnical Indicators in a State2mMoving Average as Input Feature2mInput Features3m 13sRole of Information Coefficient2mAvoiding Correlated Inputs2mTime Signature as Input Feature2mAdditional Reading10m
- Policies in Reinforcement LearningIn this section, you will learn how a policy is used by the RL model to choose the method used for selecting an action. You will learn about exploration and exploitation based policies, and the differences between them.Policies in Reinforcement Learning4m 7sDefinition of Policy2mTypes of Action2mExploration Versus Exploitation2mBest Reinforcement Learning Policy2mUse of Epsilon Value2mFunction to Calculate Epsilon2mPlotting Epsilon Value Curve2mProbability of Random Number2mReduction of Exploration Rate2mAdditional Reading10mTest on States, Q-Learning and Policies16m
- Challenges in Reinforcement LearningIn this section, you will learn about the challenges in designing a reinforcement learning model for the financial markets. Addressing these challenges will help you develop a potent trading system using reinforcement learning.Difficulties in RL3m 37sDifference Between Chaos Types2mImportance of Type 2 Chaos2mEfficiency of Noise Filters2mEffect of Changing Market Regime2mReinforcement Learning Concept25m 28s
- Initialise Game ClassEach trading game is treated as its own game with a start, play period and end and a final score or reward. This whole process is done inside the Game class. In this notebook, you will learn how to initialise the Game class.Introduction to Part II2mHow to Use Jupyter Notebook?1m 54sWorking With Pickle File5mInitialise Game Class10mRead Price Data5mResample Price Data5mResampling Price Bars2m
- Positions and RewardsIn this section, you will learn to update the trading positions based on the actions suggested by the neural network. You will also learn different pnl based reward systems.Positions and Rewards2m 7sElement of Reinforcement Learning2mWhat Action Do You Take?2mUpdate the Positions10mSame Action2mNo Position and Buy Action2mOpposite Action2mReward System10mCalculate Percentage PnL5mCategorical PnL Reward5mDifference Between Two PnL Rewards2mAdditional Reading10m
Input Features
In this section, you will learn in detail about the various input features used in the construction of a state. These are candlestick bars, technical indicators and time signatures. You will also learn about the importance of the stationary input features in creating a state.Input Features1m 58sWhy Time Signature?2mGranularity of Candlesticks2mWhich Technical Indicators?2mCandlestick Input Features2m 34sWhy Stationary Features?2mEndogenous Features2mExogenous Features2mConstruct and Assemble State
In this section, you will learn to create input features in Python. Once you are ready with the input features, you can assemble them to construct a state. This state is passed to the neural networks as an input. Based on the input state, the neural network predicts the actions; buy, sell or hold.Construct and Assemble State3m 42sHow to Make Data Stationary?2mGet Last N Time Bars5mSize of State Vector2mOutput of the Code2mGet Last N Timebars2mMinute Price Data and Resampling Techniques10mAssemble States10mFlatten the Array5mNormalise Candlesticks5mCalculate RSI5mCalculate Aroon Oscillator5mDatetime2mTime of the Day5mDay of the Week5mAdditional Reading10mTest on Features and State Construction14m- Game ClassIn this section, you will learn to create a full Game class starting with the initialisation of the Game class, updating the position, calculating the reward and assembling the state.Game Class10mact() Method Returns?2mCreate Game Class Environment5m
- Experience ReplayIn experience replay, we use a memory buffer to store Current State, Action, Reward for action, Next State, as well as whether the game is over or not. This is called one experience. Experience replay is an integral part of reinforcement learning which uses random sampling of previous experiences to train the neural network. Random sampling helps speed up the learning process due to the experiences being uncorrelated with each other.Memory and Saving3m 30sAdvantages of Random Sampling2mStructure of Replay Buffer Entries2mLength of Replay Buffer2mObjective of Experience Replay2mQ Value Update3m 14sQ Value Update2mWhich are True for Experience Replay?2mExperience Replay Implementation10mTruncate Length of Replay Memory2mNumber of Columns in Target Array2mNumber of Columns in Input Array2mSize of Input Array2mGenerate Random Numbers5mGet SARS Values5mPredict Q Values from Current State5mPredict Maximum Q Value from Next State5mValue of Target Array2mUpdate Target Array5mAdditional Reading10m
- Artificial Neural Network ConceptsIn this section, you will first learn about the workings of an Artificial Neural Network, the way inputs get multiplied with weights and passed into nonlinear functions to generate outputs. You will learn about how these weights are changed using optimization algorithms to reflect ground truths. Thereafter, you will learn about overfitting and why it is particularly tough to train on financial data.Artificial Neural Network2m 34sUse of Q-Tables2mInput State2mWeights of the Neural Network2mGradient Descent and Loss Function2m 34sGradient Descent2mLoss functions2mOverfitting2m 46sDifficulty in Modelling Financial Data2mAdditional Reading10m
- Artificial Neural Network ImplementationIn this section, you will learn about and implement Double Deep Q Learning agents using Keras. Further, you will go through the learning agent architecture as well.Agent Implementation4m 11sUse of two Q-Tables2mSize of hidden layer2mLoss function of DDQN Agent2mActivation Function2mLearning rate2mANN in Keras10mCreate Sequential Object5mParameters in Dense Layer2mCreate Dense Layer5mAdd Layer to the Neural Network5mModel Compile5mFAQs: Neural Networks10mAdditional Reading10mTest on Artificial Neural Network14m
- Backtesting LogicThe RL model is initialised with the help of Game class, two deep neural networks and replay memory. You will go through the intuition of how the different components of the reinforcement learning model come together.Combining Elements of RL Model2m 21sMeaning of an Episode2mExit Process of RL2mGoing Through Dataset2mSequentially Accessing Dataset2mProcess of Backtesting3m 44sInitialising Components of RL2mWay of Selecting Action2mProcess of Backtesting2mStoring in Replay Memory2mUpdating and Freezing Models2mModel R Update Frequency2mBacktesting Logic10m
- Backtesting ImplementationApply the knowledge of the previous sections to build a reinforcement learning model and start playing games on the price datasets.Backtesting Implementation10mCalculate Epsilon5mExploitation Vs Exploration2mRandomly Generated Action5mAdditional Reading10mGenerate Action Through Deep Q Network5mTrain the Model5m
- Performance Analysis: Synthetic DataBefore we use a real dataset of price data, it is advisable to test the RL model on a known series. Thus, a synthetic data set consisting of sine waves and trending price pattern is created as an input for the reinforcement learning model. This will help analyse the performance of the model.Generating Patterns for RL Model2m 5sImportance of Testing Known Patterns2mUsing Random Data Generator2mPure Sine Wave and Trend Series2mSynthetic Time Series Patterns10mCreate a Trending Pattern5mCreate a Mean Reverting Pattern5mAdd Noise to a Signal5mPerformance on Synthetic Data1m 39sDifferent Result on Same Dataset2mVaried Performance in Similar Scenario2mSelection of Correct Model2mApply RL on Synthetic Mixed Wave Pattern10mConfiguration Parameters3m 7sStability of a Reinforcement Learning Model2mTuning of a Reinforcement Learning Model2m
- Performance Analysis: Real World Price DataIn this section, you will apply the Reinforcement Learning Model on real world price data and then analyse the performance.RL Model on Real World Price Data2m 12sRL Model on Real World Price Data10mFrequently Asked Questions10mReinforcement Learning Implementation31m 37sTest on Backtest and Performance Analysis14m
- Automated Trading StrategyIn this section, you will first learn about the steps to automate your trading. After a brief overview of the basics, you will learn how to integrate your trading algorithm with Interactive Brokers API using IBridgePy.Automated Trading Overview2m 20sSteps in Live Trading2mTasks Required for Live Trading2mRepeated Actions in Live Trading2mStreaming Live Data2mApplication Programming Interface2mAutomated Execution of Trades10mIBridgePy Course Link10mPlacing Orders2mGetting Historical Price2mScheduling the Strategy2m
- Paper and Live TradingIn this section, you will learn about the challenges in live trading, and get answers to the FAQs regarding the same. You will understand the basic program flow of a live trading strategy. A live trading strategy template will also be provided to you. You can tweak the template to deploy your strategies in the live market!Live Trading FAQs2mLive Trading Flow Diagram10mTemplate Documentation10mTemplate Code Files2m
- Capstone ProjectIn this section, you will undertake a capstone project on real-world data. This project will require you to apply and practice the concepts learnt throughout this course. You will also get a model solution at the end of the section.Capstone Project: Getting Started10mProblem Statement10mModel Solution Template: Building the RL Model10mFrequently Asked Questions10mTemplate Code Files2mModel Solution: Combining the Agents10mCapstone Model Solution FAQs2mCapstone Solution Downloadable2m
- Future EnhancementsThe RL model can be modified and tweaked to suit the needs of the individual trader. In this section, you will explore the various methods in which the state, action and reward can be enhanced further.Future Enhancement3m 5sDesigning Actions for Portfolio2mCondition to Stop RL Model2mAvoiding Buy and Hold2mBest Reward Function2mInput Features for Gold Trading2mCapital Allocation for Crude Oil2mInput Features for Calendar Anomalies2mGenerating Higher Returns2mDealing With Regime Change2mExploration Rate After Million Trades2mAdditional Reading10m
- Run Codes Locally on Your MachineLearn to install the Python environment in your local machine.Uninterrupted Learning Journey with Quantra2mPython Installation Overview2m 18sFlow Diagram10mInstall Anaconda on Windows10mInstall Anaconda on Mac10mKnow your Current Environment2mTroubleshooting Anaconda Installation Problems10mCreating a Python Environment10mChanging Environments2mQuantra Environment2mTroubleshooting Tips For Setting Up Environment10mHow to Run Files in Downloadable Section?10mTroubleshooting For Running Files in Downloadable Section10m
- Course SummaryThis section includes a course summary and downloadable zipped folder with all the codes and notebooks for easy access.Course Summary2m 44sPython Codes and Data2m
- IntroductionThis 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.Introduction4m 14sCourse Structure3m 42sCourse Structure Flow Diagram2mQuantra Features and Guidance4m 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 Questions2mPart 1: Overview3m 4sVertical 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 Strategies2mBull Call Spread2mSetup Bull Call Spread2mBull Call Spread Payoff2mSetup Bear Put Spread2mBear Put Spread Payoff2mMarket Analysis for Spread Trading2mFeatures 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 Underlying3m 56sObjective of the Decision Tree Classifier5mBenefit of Historical Returns5mUse of Technical Indicators5mML Algorithms and Stationary Data5mHow to Use Jupyter Notebook?2m 5sPredictor and Target Variables5mCalculate Returns Over Multiple Time Periods5mCalculate the NATR5mDefine the Target Variable5mForecast 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 ML3mData Splitting5mEvaluating Performance5mParameter max_depth5mDecision Tree Classifier to Forecast the Underlying5mInitialise the Decision Tree Classifier5mTrain the Decision Tree Classifier Model5mAdditional Reading on Forecasting with Decision Tree Classifier2mMetrics 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 Effectiveness4m 27sAccuracy of ML Model2mInterpretation of Accuracy2mMeaning of Confusion Matrix2mInterpreting Confusion Matrix2mPredicting Wrong Values2mFalse Positives in Confusion Matrix2mBeyond Accuracy4m 2sDescription of Precision2mPredicting Correct Signals2mDescription of Recall2mCalculation of Precision2mCalculation of Recall2mCalculation of f1 Score2mInference of Performance Metrics2mMetrics to Evaluate a Classifier5mHow to Use Interactive Exercises?5mConfusion Matrix5mClassification Report5mAdditional Reading10mTest on Forecasting the Underlying with ML12mOptions 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 Data4m 15sOption Price Data2mData Derived from Options Data2mNeed for Dividend Data2mNeed for Underlying Data2mSourcing Options Data2mOptions Data Storing5mEOM Contracts5mPython Libraries5mWorking With Pickle File5mAdditional Reading on Data Vendors10mOptions 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 Strategy2mSet Up the Call Spread Strategy5mATM Strike Price5mBacktesting Options Spread Strategy5mTrade 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 I5mTrade Level Analytics II4m 21sDefine Win Trades2mCalculate Win/Loss Rate2mCalculate Average PnL Per Trade2mIdentify the Correct Strategy-I2mIdentify the Correct Strategy-II2mLimitations of Win Trade2mCalculate Average Trade Duration2mInterpret the Profit Factor2mCalculate the Profit Factor2mTrade Level Analytics of ML Based Spread Trading Strategy10mAverage PnL Per Trade5mLimitations of Profit Factor2mAverage Trade Duration5mAnalyse the Strategy Performance2mTest on Trading Bull Call Spread with ML10mImproving 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 Strategy3m 3sWay to Improve ML Model5mMethods to Improve ML-model Based Strategy5mRole of Probability in Improvement of ML Model5m- Hyperparameter Tuning and Cross-Validation MethodsIn 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-validationHyperparameter Tuning3m 40sChoice of Best Hyperparameters5mIncrease of Accuracy and Hyperparameter Tuning5mHyperparameter Tuning with Choice of Range5mKnowledge of Range and Hyperparameter Tuning5mTotal Number of Hyperparameters Combinations5mCross Validation4m 39sUsage of Cross-Validation5mReason for Creation of Test Dataset5mSteps in Cross-Validation5mOrder of Time Period in Dataset5mSize of Datasets in Cross-Validation5mSplit Data in Blocked Cross-Validation5mCross-Validation Techniques5mAdvantage of Blocked Cross-Validation5mAdditional Reading2m
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 Model2mDifference Between Probability and Probability of Occurrence5mCorrect Usage of Predicting Probability Method5mEffect of Probability Levels on Model Performance5mPredicted Output After Set Probability Level5mControl of Probability Levels in Model5mCalculation of Probability of Occurrence5mChallenges in Usage of Predicting Probability Method5mImplementation of Probability Level in ML Model5mInference of Class Probabilities5mSet Probability Level5mAdditional Reading2mTest on Techniques to Improve ML Model Performance10mEnsemble 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 Model3m 57sNeed of Random Forest Classifier Model5mInclusion of ML Models in Random Forest Model5mUse of Train Data in Random Forest Classifier Model5mReason for Inclusion of Multiple Decision Trees in Random Forest5mVoting Classifier Model2m 57sVoting Classifier and ML Models5mHard Voting Classifier Model5mSoft Voting Classifier Model5mAdvantage of Voting Classifier Model5mVoting Classifier Model5mImplement Hard Voting Classifier Model5mImplement Soft Voting Classifier Model5mAdditional Reading2m- Blending ModelsBlending 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 Models4m 5sLimitation of Voting Classifier Model5mNaming Convention for Blending Model5mPurpose of Meta Model5mNeed of Predicted Output of Base Model5mImprovement in Performance from Blending Model5mInitial Step to Blend Machine Learning Model5mTraining of Base Models5mTraining of Meta Model5mDifference Between Base and Meta Model5mEnsemble Model for Prediction5mComparison of Base and Meta Model's Performance5mDisadvantage of Meta Model5mBlending of Machine Learning Models5mUsage of Blender Model for Prediction5mTest on Ensemble Models10m
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 Models4m 6sParametric and Nonparametric Model Characteristics5mMachine Learning Models5mNonparametric Model5mOptions Pricing Model5mAdditional Reading on Parametric and Nonparametric Models2mOptions 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 Pricing3m 42sTarget Variable5mMoneyness5mYears to expiry5mSize of the dataset5mInput Features5mFeatures for Options Pricing5mMoneyness5mMerge the Data5mML 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 Prices2mHidden Layers5mShuffle the Data5mActivation Function5mPredicting Options Prices5mSplit the Data5mCompute the Prediction Error5mInterpret the Plot5mPolyfit5mOptions Pricing with Multiple Models5mPrediction Error5mPlot for Multiple Models5mAdditional Reading on Options Pricing2mTest on Options Pricing10mImplied 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 Volatility1m 28sMeasurement of Volatility2mImplied Volatility Inference2mProperties of Implied Volatility2mAdditional Reading for Black-Scholes Model2mAdditional Reading for Implied Volatility2mImplied Volatility Calculation5mCalculate Implied Volatility5mForecasting 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 Volatility5m 24sModel Creation Process5mNon-Stationary Features5mData Quality Issue5mData Preprocessing5mCall LTP5mMachine Learning Models5mAdditional Reading for Random Forest Model2mForecasting IV5mActual Vs Predicted IV Graph5mFeature Engineering5mCalculate the ADX indicator5m- Trading Options Using Forecasted IV ValuesYou 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 Straddle2m 12sMarket Conditions5mRisk Management5mBacktest Short Straddle Strategy5mExit Price5mExit Conditions - Short Straddle5mEntry Condition5mExit Condition5mLimitations - Forecasted IV Values5mTest on Trading Implied Volatility10m
- Need for ML to Predict Option Strategy to TradeThere 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 Prediction1m 37sNeed for Application of Machine Learning5mSelection of an Options Strategy5m
- Defining the Best Option Strategy to TradeIn 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 Variable3m 18sCreating the Target Variable - Strategy Design5mTarget Variable for the ML Model5mList of Strategies5mCreate the Combinations of Positions5mFilter the Strategies - 15mFilter the Strategies - 25mCreating the Target Variable Using Strategy Returns5m
- Input Features for Predicting the Best Options StrategyCreating 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 Features1m 46sInput Features for the Machine Learning Model5mInput Features of Underlying Assets5mOptions Greeks as Features5mCreating the Input Features5mFeature to Study Momentum of the Underlying5mFeature to Study Volatility of the Underlying5mNormalise the Upper Bollinger Band5m
- Model Design and Backtesting the PerformanceThis 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 Deploy2m 2sMulti-Class Classification Problems5mLearning Rate for LSTM5mMachine Learning Model Design5mBacktest the Predicted Strategies5mTrade Level Analytics of Predicted Strategies5mStrategy Analytics of Predicted Strategies5mTest on ML Model to Predict Strategy14m
- Challenges in Live TradingThis 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 Challenges5m 50sPickle Parameter2mDump Command2mSerialization2mSave The Model2mSave The Data2mChallenges In Retraining The Model3m 25sRetrain A Model2mHow To Perform Simulation3m 47sSimulation Of Trading2mData Leakage2mSave Train and Simulate ML Model5m
- Run Codes Locally on Your MachineIn 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.Uninterrupted Learning Journey with Quantra2mPython Installation Overview1m 59sFlow Diagram10mInstall Anaconda on Windows10mInstall Anaconda on Mac10mKnow your Current Environment2mTroubleshooting Anaconda Installation Problems10mCreating a Python Environment10mChanging Environments2mQuantra Environment2mTroubleshooting Tips for Setting Up Environment10mHow to Run Files in Downloadable Section?10mTroubleshooting for Running Files in Downloadable Section10m
- Capstone ProjectIn 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 Started2mProblem Statement2mCode Template and Data Files2mCapstone Project Model Solution5mCapstone Solution Downloadable2m
- Live Trading on IBridgePyIn 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 Overview2m 2sLive Trading Overview2m 41sVectorised vs Event Driven2mProcess in Live Trading2mReal-Time Data Source2mCode Structure2m 15sAPI Methods10mSchedule Strategy Logic2mFetch Historical Data2mPlace Orders2mIBridgePy Course Link10mAdditional Reading10mFrequently Asked Questions10m
- Paper and Live TradingTo 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 Documentation10mTemplate Code File2m
- Additional Applications of ML for Options TradingSo 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 Trading2mApplications of ML for Options Trading5mSentiment Data for Options Trading5m
- SummaryIn 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 Summary4m 17sSummary and Next Steps2mPython Codes and Data2m
- IntroductionThis section serves as a preview of the course and introduces the course contents. The interactive methods used in this course will assist you in not only understanding the concepts but also answering all questions regarding LLMs. This section explains the course structure as well as the various teaching tools used in the course, such as videos, quizzes, and coding exercises.Introduction to the Course4m 54sInspiration for the Course2mCourse Features2mCourse Structure2mQuantra Features and Guidance2m 38sFAQs2m
Introduction to Generative AI
In this section, you will discover what generative AI is, how it differs from traditional machine learning models, and explore Large Language Models (LLMs) and their rapid evolution over the years.Part Overview: Evolution of AI2mGenerative AI2mDefine Generative AI5mGenerative AI vs Traditional ML Models5mDefine Large Language Models5mInput Accepted by LLMs5mOutput Generated by LLMs5mFAQs on Generative AI2mAdditional Reading on Generative AI2m- Machine Translation and LLMsDid you know that LLMs were inspired by machine translation models? In this section, we'll explore the history of machine translation, from early rule-based systems to modern data-driven approaches. You'll learn how these models evolved thereby improving accuracy and laying the foundation for today's powerful LLMs.Machine Translation2mFirst Attempts5mIssues With the Initial Approach5mImprovement in Machine Translations5mRecent Developments in Machine Translation5mEvolution of Machine Translation Models5mHow Do LLMs Work?2mCategory of Model5mConverting Text to Numbers5mMultiple Layers in LLM5mOperations in LLMs5mFinal Vector5mFAQs on Machine Translation Models and LLMs2mAdditional Reading2mTest on Generative AI, Machine Translation, and LLMs10m
- Progression of Neural NetworksEver wondered how neural networks evolved from simple models to sophisticated systems capable of handling complex sequences? In this section, you will learn how neural networks have evolved over time, starting with Recurrent Neural Networks (RNNs) and progressing to Long Short-Term Memory networks (LSTMs).Recurrent Neural Networks2mType of Data for RNNs5mOutput at Each Time Step5mRNN for Long Sequence of Data5mRelationship Between Input and Output5mLimitations of RNN5mRNN vs. LSTM2mLimitation of RNN5mLSTM vs. RNN5mGates in LSTMs5mTranslation Tasks5mRole of Encoder5mRole of Decoder5mFAQs on Progression of Neural Networks2mAdditional Reading on Progression of Neural Networks2m
- Attention MechanismIn this section, you will be introduced to attention mechanisms and how they were used to enhance LSTMs, addressing long-term dependency issues. You'll learn how attention helps models focus on crucial information across longer sequences, improving their ability to retain context over time.LSTM With Attention Mechanism2mAttention Mechanism5mPrimary Function of the Encoder5mLSTM Modification5mTraditional Encoder-Decoder Structure5mFAQs on Attention Mechanism2mAdditional Reading on Attention Mechanism2mTest on Neural Networks and Attention Mechanisms10m
- Introducing TransformersIn this section, you will be introduced to the use of attention mechanisms all by itself, also known as Transformers. We'll briefly explore the groundbreaking "Attention Is All You Need" paper to understand how this led to the development of Transformers.The Beginning of Transformers2mInnovation in "Attention is All You Need"5mLimitation of RNNs and CNNs5mBenefit of the Transformer Model5mCNNs and Long-Term Memory5mChallenges of Deeper CNNs5m
- Transformers and Its ElementsCurious about what makes Transformers so powerful? Here, you will examine the key elements of the Transformer architecture. You’ll learn about its core components, including self-attention mechanisms, positional encoding, and the encoder-decoder structure, which together enable Transformers to process and generate sequences efficiently.Transformer Architecture: Encoder Elements2mRole of Input Embedding5mRole of Positional Encoding5mInput of the Multi-Head Attention5mRole of the Multi-Head Attention5mRole of the Feedforward Network5mMeaning of Nx5mTransformer Architecture: Decoder Elements2mDifference Between Encoder and Decoder5mMasked Multi-Head Attention5mLinear Layer5mSoftmax Layer5m
- Transformers vs. Sequence ModelsIn this section, you will explore how Transformers overcame the challenges of sequence models. We'll discuss how their architecture addresses issues like long-term dependencies and parallel processing, making them more effective and efficient for handling complex sequences.Transformers vs. RNNs and LSTMs2mLimitations of RNNs and LSTMs5mProcessing Time in RNNs and LSTMs5mProcessing in Transformers5mLong-Range Dependencies in Transformers5mAdvantage of Transformers5mState-of-the-Art models in NLP5mImproving Translation Quality5mFAQs on Transformers2mSummary2mAdditional Reading on Transformers2mTest on Transformers10m
- Process of Training an LLMThis section offers a high-level overview of training Large Language Models (LLMs), covering the use of internet data to build foundational models and the role of reinforcement learning through human feedback (RLHF) to align these models with human expectations.Part Overview: LLM Training and Prompt Engineering2mProcess of Training an LLM2mDefinition of an LLM5mTraining of LLM5mTraining Process of LLM5mPurpose of Human Feedback5mPrediction of Multiple Answers5mUltimate Goal of LLM5mFAQs on Process of Training an LLM2mSummary2mAdditional Reading2m
- Brief Overview of Prompt EngineeringIn this section, you will learn how to use prompt engineering with examples from the trading domain, including question answering, iterating, summarising, sentiment analysis, and translation. By mastering these techniques, you'll be able to use LLMs effectively when you are creating trading strategies.Brief Overview of Prompt Engineering2mDefinition of Prompt Engineering5mPrompt Similar to Human Interaction5mIteration in Prompt Engineering5mCondensation of Financial Prompts5mDetermination of Tone in Passage5mLLM and Strategy Creation5mPractical Use of Translation5mImportance of Prompt Engineering5mFAQs on Prompt Engineering2mSummary of Prompt Engineering2mAdditional Reading2mTest on LLM Training and Prompt Engineering16m
- Applications of LLMs in FinanceExplore the idea of generating Python code based on research papers using LLMs and list examples of financial LLMs.Part Overview: Applications of LLM2mApplications of LLMs in Finance2mExperience of Creating Strategy Code Using LLM5mEffectiveness of LLM Generated Code5mUsage of LLMs by Traders5mGeneral Purpose LLM5mSpecialised LLM5mJP Morgan LLM5mFeature of BloombergGPT5mFAQs2mSummary2mAdditional Reading2m
- Overview of FinBERT ModelIllustrate the differences between finBERT and BERT, the specific training process of finBERT, and why finBERT is better suited for financial sentiment analysis.Overview of FinBERT Model2mCreation of FinBERT5mDifference Between BERT and FinBERT5mPre-train FinBERT Model5mFine-tune FinBERT Model5mAdvantage of FinBERT5mPrimary Focus of FinBERT5mFAQs2mSummary2mAdditional Readings2mTest on Applications of LLMs12m
- Sentiment Analysis Trading ProcessThis section covers the sentiment analysis trading process, starting with data collection from sources like FOMC transcripts and earnings calls, then moving on to data preprocessing, where we convert and clean the data for sentiment scoring using specialised models like FinBERT and finally applying applying sentiment scores in trading strategies and analysing their performance.Sentiment Analysis Trading Process2mFirst Step in the Sentiment Analysis Trading5mPreprocessing Stage5mGenerating Sentiment Scores5mSetting Thresholds5mRaw Audio Data5mPerformance Analysis5mAdditional Reading on Sentiment Analysis Process2m
Data Collection and Preprocessing
We'll transform raw FOMC transcripts into clean, actionable data by extracting key parts of the FED Chairman’s speech and removing irrelevant content. The transcript is then segmented into minute intervals to capture detailed sentiment shifts. Finally, we'll pull in price data and set the stage for backtesting sentiment-driven strategies.Data Collection2mData Preprocessing2mExtracting Text5mHeader and Footer Text5mPython Library for Extracting Text5mIrrelevant Q&A5mNumber of Words per Minute5mPoor Performance5mGenerate Alpaca API Keys2mData Collection and Preprocessing5mHeader/Footer Filtering Function5mData Merging5mSentiment Analysis of FOMC Transcripts
The FinBERT model can be used to analyse the financial data and generate sentiment scores. In this section, you will learn to score the FOMC meeting transcripts at a one-minute frequency.Score The Sentiment of FOMC Transcripts2mUnderstanding FinBERT for Sentiment Analysis5mFunctions in the FinBERT Python File5mUsing FinBERT Functions for Sentiment Scoring5mSentiment Score Range and Interpretation5mImplementing FinBERT for FOMC Transcripts5mSentiment Score of FOMC Transcripts5mFunction to Load FinBERT Model5mFunction to Score Sentiment of Multiple Sentences5mFAQs on Sentiment Analysis of FOMC Transcripts2mSummary of Score the Sentiment of FOMC Transcripts2mAdditional Reading on Scoring the Sentiment2mTrade FOMC Meeting Using Sentiment Score
The sentiment scores of the FOMC meetings at a one-minute frequency can be used to generate trading signals. In this section, you will learn a trading strategy to trade FOMC meetings based on sentiment score, backtest it and analyse the performance.Trading Strategy Based on Sentiment Score2mStrategy Based on Sentiment Score5mUnderstanding Rolling Sentiment Score5mDefining Thresholds for Trade Signals5mExiting a Short Position5mStrategy Flow Diagram2mTrading Strategy Based on Sentiment Score Threshold5mUse of Signal Information5mCalculate Trade Level Analytics5mFAQs on Trading Strategy Based on Sentiment Score2mSummary of Trade FOMC Meeting2mAdditional Reading on Trading FOMC Meeting2mTest on Scoring and Trading Sentiment Score14m- Strategy Variations to Trade the FOMC MeetingThere are many variations of the strategy based on sentiment score to trade the FOMC meetings. This section covers the variations of strategy based on the time to enter and exit and considers additional conditions such as price trends.Variations for Sentiment-Based Strategies2mUnderstanding the First Sentiment-Based Strategy5mRolling Text and Its Use in Strategy5mAdding Price Trend to the Strategy5mExiting the Trade5mPost-FOMC Trading Variation5mTrading Strategy Based on Rolling Text5mCalculate the Rolling Text5mTrading Strategy With Sentiment Score and Price Trend5mConditions to Enter Positions5mTrading Strategy Post FOMC Meeting and Price Trend5mTrading Strategy Entry Post Report5mFunction to Update Signal Column5mFAQs on Variations for Sentiment-Based Strategies2mSummary of Strategy Variations2mAdditional Reading on Variations of Strategy2mTest on Strategy Variations14m
Sentiment Analysis Using Audio Data
In this section, you will try to list the process of converting audio files to a transcript format which can be read by an LLM.Sentiment Analysis Using Audio Data2mTranscribing Audio to Text5mPurpose of Audio Transcription5mFirst Step of Whisper Model5mConversion of Video Format5mStep After Audio Transcription5mAccuracy of Whisper Model5mSpeech to Text5mFAQs on Sentiment Analysis Using Audio Data2mSummary of Sentiment Analysis Using Audio Data2mAdditional Reading2m- Challenges and Deployment in ProductionThis section explores key challenges in using and deploying large language models (LLMs), including contextualization, quality assurance, etc. It also covers best practices for deploying LLMs, comparing enterprise solutions, and discussing open-source models like Meta's LLaMA.LLM: Challenges2mImproving LLM Responses5mBenefits of Retrieval-Augmented GPT Models5mLLM Concerns5mMitigating Challenges5mLLMs Without RAG5mLLM Deployment Essentials2mRLHF in Enterprise Platform5mOpen-Source LLM by Meta5mThird-Party Packages in LLM Deployment5mEfficient Fine-Tuning of Large LLMs5mOptimising LLM Deployment for Performance5mKnowledge Distillation5m
- Capstone ProjectIn this section, you will apply the knowledge you have gained throughout the course. You will work on a capstone project where the goal is to generate sentiment scores from the earnings call audio of publicly listed companies.Getting Started2mProblem Statement2mCapstone Project Model Solution5mCapstone Data Files2m
- Run Codes Locally on Your MachineLearn to install the Python environment in your local machine.Uninterrupted Learning Journey with Quantra2mPython Installation Overview1m 59sFlow Diagram10mInstall Anaconda on Windows10mInstall Anaconda on Mac10mKnow your Current Environment2mTroubleshooting Anaconda Installation Problems10mCreating a Python Environment10mChanging Environments2mQuantra Environment2mTroubleshooting Tips for Setting-up Environment10mHow to Run Files in Downloadable Section?10mTroubleshooting For Running Files in Downloadable Section10m
- Summary of the CourseIn this section, we will summarise all the learning from the course. All the data files and code used in this course can be downloaded from the downloadable unit of this section.Course Summary2mSummary and Next Steps2mPython Codes and Data2m
about author






Why quantra®?
- More in Less Time
Gain more in less time
- Expert Faculty
Get taught by practitioners
- Self-paced
Learn at your own pace
- Data & Strategy Models
Get data & strategy models to practice on your own
Faqs
- Are there any webinars, live or classroom sessions available in the course?
No, there are no live or classroom sessions in the course. You can ask your queries on community and get responses from fellow learners and faculty members
- Is there any support available after I purchase the course?
Yes, you can ask your queries related to the course on the community: https://quantra.quantinsti.com/community
- What are the system requirements to do this course?
Fast-speed internet connection and a browser application is required for this course. For the best experience, use Chrome.
- What is the admission criteria?
There is no admission criterion. You are recommended to go through the prerequisites section, be aware of skill sets gained and to learn the most from the course.
- Is there a refund available?
We respect your time, and hence, we offer concise but effective short-term courses created under professional guidance. We try to offer the most value within the shortest time. There are a few courses on Quantra which are free of cost. Please check the price of the course before enrolling in it. Once a purchase is made, we offer complete course content. For paid courses, we follow a 'no refund' policy.
- Is the course downloadable?
Some of the course material is downloadable such as Python notebooks with strategy codes. We also guide you to use these codes on your own system for you to practice further.
- Can the Python strategies provided in the course be used immediately for trading?
We focus on teaching about quantitative and machine learning techniques and how learners can use them for developing their own strategies. You may or may not be able to directly use them in your own system. Please do note that we are not advising or offering any trading/investment services. The strategies are used for learning & understanding purposes and we do not take any responsibility for the performance or any profit or losses that using these techniques results in.
- Are you using real time Stock market data in the course?
No. We do not take examples from 'real time data', but you shall be learning to code through historical data. Please do note that there is a section at the end that will guide you on how to automate for real time live trading. You can get more detailed learning on how to automate trading strategies through our free course, 'Automated trading with IBridgePy using Interactive Brokers Platform'.
- Will I be getting a certificate post the completion of the programme?
Yes, you will get a certificate for each course separately within a few hours of completion of the course. The certificates are downloadable from your account tab "My Certificates".
- What does "lifetime access" mean?
Lifetime access means that once you enroll in the course, you will have unlimited access to all course materials, including videos, resources, readings, and other learning materials for as long as the course remains available online. There are no time limits or expiration dates on your access, allowing you to learn at your own pace and revisit the content whenever you need it, even after you've completed the course. It's important to note that "lifetime" refers to the lifetime of the course itself—if the platform or course is discontinued for any reason, we will inform you in advance. This will allow you enough time to download or access any course materials you need for future use.
- Is Python an essential skill for automated trading for beginners?
Python is not strictly essential for beginners in automated trading, but it is highly recommended. Here’s why:
Ease of Learning: Python has a beginner-friendly syntax, making it accessible even for those new to programming.
Versatility: Python is widely used in the finance industry for tasks like backtesting, data analysis, and building trading algorithms. Libraries like Pandas, NumPy, and TA-Lib make it easy to analyse financial data
Extensive Community Support: Python's popularity means a vast amount of tutorials, forums, and resources are available for troubleshooting and learning.
Integration with Broker APIs: Many brokers and trading platforms offer APIs with Python support, enabling seamless integration for order execution and real-time data analysis.