Skip to content

Using Data Mining methods and ML models to predict future behavior of stocks.

License

Notifications You must be signed in to change notification settings

letitbesb/FullScaleStockAnalysis

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FullScaleStockAnalysis

Using Data Mining methods and ML models to predict future behavior of stocks.

Github takes too long to render the notebooks with large size. To view .ipynb file 👉🏼👉🏼👉🏼 Click here 👈🏼👈🏼👈🏼

We are using the financial dataset from 'yfinance' library by yahoo finance. The Dataset consists of attributes like: Date, Open, High, Low, Close, Volume, OpenInt.

We have analyzed the behavior of stocks and predict its future, considering how it performed in the last couple of years and what factors affected it.

Techniques Used:

  • Moving Average

    • Linear Moving Average
    • Exponential Moving Average
  • Correlation Matrix:

    1 Shows measure of correlation between different stocks.

  • Monte Carlo Algorithm

    3 This helps us in Risk Analysis. Monte Carlo simulation produces distributions of various possible outcome values.

  • LSTM ML model

    4 LSTMs help us to predict the direction of stock trends correctly!

Outcome

We used different stock analysis techniques. Each technique gave a different result. We used the Moving Average Technique to predict stocks’ future closing/opening price and observed that exponential M.A was more responsive than Linear M.A. Also, when one wants to invest for long term investment, they should go for a smoother curve since it is more resistant to sharp price jumps. Choosing a stock depends on the individual. A graph of M.A. with more zigzags is riskier. We then used the coefficient matrix to find the relations between different stocks. We concludedthat Google and Microsoft have the most correlated daily profit, whereas Tesla & Walmart have the least. Then, we formed portfolios and calculated the Sharpe ratio offered by each company. Walmart had the highest Sharpe ratio compared to others and thus is the most preferred stock. Monte Carlo Algorithm gave us all the possible paths our stock could have traveled from the opening day. We used a histogram to find the most probable path of that stock and distinguished stocks as risky or stable. Apple. Microsoft, TSMC, Johnson & Johnson, and Walmart & Nestle were some of the stable stocks. We then used the LSTM Machine Learning model to predict the closing stock price of Google, and we could see that LSTMs are good when it comes to predicting stock price behavior and not exact values.

Note :

This project was done by - Shreyash Bhardwaj 2020A7PS2066H Nikhil Raj 2020A7PS0093H

for the course DATA MINING ( CS F145 )

About

Using Data Mining methods and ML models to predict future behavior of stocks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 100.0%