Skip to content

Dev1nW/Stock-Predictor-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Stock-Predictor-App

THIS IS NOT INVESTMENT ADVICE BUT IS RATHER MEANT TO BE USED FOR EDUCATIONAL PURPOSES AND FUN.
DO NOT USE THIS CODE FOR INVESTING PURPOSES.



A project that is used for educational purposes to learn a foundation in Tkinter, Tensorflow, Scikit-learn, Pandas, Numpy and Matplotlib.

Setup

In order to run the code, you must install specific libraries:


    $ Tensorflow==2.6.1
    $ numpy==1.18.5
    $ pandas==0.24.2
    $ scikit-learn==0.24.2
    $ matplotlib==3.3.4

Background

This code was created out of curiosity, I used 2 videos to create a solid foundation they are as follows:


    Stock Price Prediction Using Python & Machine Learning by Computer Science
This is video gave a foundation for the Machine Learning Algorithm to predict stock prices


    Build A Python GUI App Tutorial by Dev Ed
This is video gave a foundation for Creating the GUI using Tkinter


    Due to my interest, I implemented a combination of these 2 tutorials and added some unique twists as well. These being that you will be able to save a png of the graph displayed at the end of the stock code, you will also save a unique model for each stock you have provided. There is also an option to save model checkpoints if you would like, and the code will automatically create a folder in the current directory which will contain the model information and graph if you choose to save it.

How to run the code

First you may want to go to here and find stocks you would like to use for your run. Once you have chosen a Stock you would like to run, for example ETH-USD you click on the Historical Data tab. Next, you can change the length of the data you would like, for example and then click Download. Now you will have a .csv file for the stock you would like. I advise keeping the .csv file in a folder along with the code so that it will be easy to find.

In order to run the code, you run the command:

    $ python3 Stock_predictor_app.py


This code creates a GUI that will display on your screen, in the GUI you have 3 choices:


    Choose Stock .csv File
    Run Stock Analysis
    Remove Stocks


    These preform their corresponding tasks, for Choose Stock .csv File, File Explorer will open and you can upload one .csv file at a time, you can add as many .csv files as you would like. Once you have added the .csv files you would like you press Run Stock Analysis, this will train and test a model to predict the price of a stock. This will run for 20 Epochs and then prompt you to give a value of 1 or 2 for if you would like to save the graph for the model, the code will then display the graph for roughly 5 seconds then close and go to the next .csv file if more than one file was uploaded.

Results

About

Stock Predictor App using Tkinter and LSTM.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages