The objective of this project is to create a tool which can aid in demystifying the statistical element of stock market prices to make trading more accessible to the average earner.
This tool leverages historical data from 21 different tickers and simulates trading actions over a one-month period based on a machine learning model. It allows the user to choose the tickers on which they want to trade and visualizes the profits made from these trades over the course of the subsequent month, using real daily closing values from the yfinance library. It also visualizes the model accuracy of the model’s 30-day projections vs. the actual price 30 trading days in the future.
This application uses create-react-app, TailwindCSS with react-chart-js2 for its data visualisation. The API endpoints to query the data and obtain the stock market data and trading simulation were written in Flask and Python. The model was generated using Python scripts, using a Random Forest Regressor from scikit-learn and processed using Pandas dataframes.
All the stock market data for training and testing the model and for visualising results are from the yfinance library.
StockPredictorDemo.mov
$ cd frontend && npm i
$ cd frontend
Then, in two different terminals
$ npm run start
$ npm run start-flask
In the future, I plan on building a site to display live performance of this model on a simulated stock portfolio using the same business logic implemented for backtesting. I also hope to create an API for other programmers to be able to use this model.