Unsupervised Learning in Trading
₹10850/-₹43399/-
75% OFF
Get for ₹8680 with Course Bundle
- Live Trading
- Learning Track
- Prerequisites
- Syllabus
- About author
- Testimonials
- Faqs
Live Trading
- Creating, backtesting and paper trading a trading strategy using a clustering algorithm
- Creating a list of pairs that are suitable for pairs trading strategy
- Intuitively and mathematically describe the working of principal component analysis (PCA)
- Detailed difference between supervised learning algorithms and unsupervised learning algorithms
- Describe, implement and list the differences between the workings of k-means clustering algorithm and DBSCAN clustering algorithm
- Concepts such as euclidean distance, WCSS and interpret elbow curve
- Curse of dimensionality and various ways to overcome the curse of dimensionality
- Applications of unsupervised learning

Skills Covered
Python
- Numpy
- Pandas
- Sklearn
- Matplotlib
- Itertools
Machine Learning
- K-Means Clustering
- DBSCAN Clustering
- Curse of dimensionality
- Principal Components Analysis
- Hyperparameter selection
Statistics and Maths
- Euclidean distance
- WCSS or inertia
- Eigenvalues and eigenvectors
- Cointegration
- Skewness & hit ratio

learning track 5
This course is a part of the Learning Track: Artificial Intelligence in Trading Advanced
Course Fees
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
A general understanding of trading in the financial markets such as how to place orders to buy and sell is helpful. Basic knowledge of the pandas dataframe and matplotlib would be beneficial to easily work with the codes and trading strategies covered in this course. To learn how to use Python, check out our Free course "Python for Machine Learning in Finance".
Syllabus
- 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
Registered Successfully!
You will receive webinar joining details on your registered email
Would you like to start learning immediately?
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
- When will I have access to the course content, including videos and strategies?
You will gain access to the entire course content including videos and strategies, as soon as you complete the payment and successfully enroll in the course.
- Will I get a certificate at the completion of the course?
Yes, you will be awarded with a certification from QuantInsti after successfully completing the online learning units.
- 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 are required for this course. For best experience, use Chrome.
- What is the admission criteria?
There is no admission criterion. You are recommended to go through the prerequisites section and be aware of skill sets gained and required to learn 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 how to use these codes on your own system to practice further.
- Can the python strategies provided in the course be immediately used for trading?
We focus on teaching these 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 don't take any responsibility for the performance or any profit or losses that using these techniques results in.
- I want to develop my own algorithmic trading strategy. Can I use a Quantra course notebook for the same?
Quantra environment is a zero-installation solution to get beginners to start off with coding in Python. While learning you won't have to download or install anything! However, if you wish to later implement the learning on your system, you can definitely do that. All the notebooks in the Quantra portal are available for download at the end of each course and they can be run in the local system just the same as they run in the portal. The user can modify/tweak/rework all such code files as per his need. We encourage you to implement different concepts learnt from different learning tracks into your trading strategy to make it more suited to the real-world scenario.
- If I plug in the Quantra code to my trading system, am I sure to make money?
No. We provide you guidance on how to create strategy using different techniques and indicators, but no strategy is plug and play. A lot of effort is required to backtest any strategy, after which we fine-tune the strategy parameters and see the performance on paper trading before we finally implement the live execution of trades.
- 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.