Giter Site home page Giter Site logo

trading's Introduction


Predict whether a company's stock will rise or fall the next day!

Prediction with LSTM!

View Demo

Table of Contents

About The Project

App Page

This project aims to predict whether a company's stock price will rise or fall the next day to find out whether we can buy a stock or not. We selected three companies and collected data from 1999 to present.

Built With

We coded this project using Python, its packages, a Database and an API :

Getting Started

To get started, you are going to need :

Prerequisites

You need to install Python from here first then download the file get-pip.py. In the terminal, go to the folder where the file was downloaded and type the following command :

python get-pip.py

Installation

Now create a folder, open it on an IDE and follow the instructions :

  1. Get a free API Key at Alpha Vantage

    • Create an apiKey.txt file in the root of the Trading folder and put your API key there.
    • To connect to MongoDB Atlas: Create a mongoKey.txt file at the root of the Trading folder and put in each line your username, password and the rest of the MongoDB Atlas link after the '@'.
  2. Open terminal and clone the repository

git clone https://github.com/SasaIA/Trading.git
  1. Install Python packages using pip
pip install -r requirements.txt
  1. Make sure to install MongoDB on your computer
  2. To launch a file, you must start the terminal and navigate to the folder that contains that file
  3. Open the terminal and type :
python api.py
python lstm.py
  1. Thats it you have the latest stock price for each company and the prediction for tomorrow.
  2. Every night, launch the updatesPrice.py file to update the database with the last stock price.
  3. To launch the app, type in the terminal
streamlit run app.py

Usage

There are different files in this project:

  • The first api.py allows to retrieve the data via the API and to store the data in a JSON file and then to send them to a database.
  • The second lstm.py predicts whether the stock will rise or fall the next day.
  • The third updatesPrice.py, allows us to update our database with the last known stock price.
  • The fourth dataviz.ipynb allows you to analyze data with different graphs.
  • The fifth app.py file is used to launch the application and have a visual on the latest stock prices, to have an overview of the graphs and predictions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.