Git Product home page Git Product logo

surfing-stock's Introduction

SURFING STOCK

Welcome to Surfing Stock, an application built using the QT library that utilizes a prediction model for stock prices based on an LSTM neural network. This app allows users to predict the stock prices for the following day using data from the seven previous days.

With its user-friendly interface, Surfing Stock is easy to use and provides users with reliable and insightful predictions. By utilizing the power of deep learning, Surfing Stock can help users make informed decisions in their investment strategies.

Table of Content

Overview

The app is designed to automatically scrape stock data using the VNStock API and predict the stock price for the following day. The app displays the predicted stock price using a chart.

Building the Model

To build a model, the process of analyzing stationary is a crucial step to ensure that the input data of the model is stable over time. Then, identifying the cycle with the highest energy impact will help you find patterns and trends in the data to improve the accuracy of the model.

Data analysis

To conduct stock analysis, we focus on analyzing the following three main components: -Stationary time-series -Seasonality -Histogram

Data Preprocessing

Based on the analysis of the main components we are interested in, we can build features using the following approaches:

  1. Adding values based on the most vital energy cycles: -Median -Rank -Variance -Mean -Standard Deviation

  2. Scaling the values using a normalization method such as StandardScaler brings the data closer to a normal distribution.

  3. Feature engineering the data by taking a rolling window of 7 days to predict the next day's value.

Layers (LSTM)

The LSTM model is used to predict the stock price using the 31 extracted feature columns.

model = Sequential()
model.add(LSTM(units = cells, return_sequences=True, activation='tanh', recurrent_activation='sigmoid', input_shape = (7, 45)))
model.add(Dropout(0.1))
model.add(LSTM(units = cells, return_sequences=True, activation='tanh', recurrent_activation='sigmoid'))
model.add(Dropout(0.1))
model.add(LSTM(units = cells))
model.add(Dropout(0.1))
model.add(Dense(units = len(cols_y)))

Optimizer (Adam)

Using the Adam optimizer for stock price prediction models has several benefits, including stability, adaptiveness, and efficiency. It helps the model converge faster, achieve better results, and optimize more efficiently than other optimizers such as SGD or Adagrad.

model = CreateModel(387)

model.compile(optimizer = Adam(learning_rate = 0.00001), loss = 'mean_squared_error', metrics = ['accuracy'])
history = model.fit(X_train, y_train, epochs= 1, batch_size= 1, use_multiprocessing= True, validation_split= 0.2, shuffle= True)

Deploying the Product

To use the Surfing Stock app, users simply need to download and install the required libraries and run the main.py file. The app will automatically scrape stock data and use the saved LSTM model to make predictions for the following day's stock price.

The predicted stock price is displayed on the app's user interface, along with a chart showing the historical and expected stock prices for the next day.

The app also includes a settings menu where users can adjust the time range of the historical stock data displayed on the chart, as well as the time range of the predicted stock price.

Overall, the Surfing Stock app provides a user-friendly and efficient way for users to make informed decisions in their investment strategies by utilizing the power of deep learning to predict stock prices.

User Interface

The product has a user interface displays the predicted stock price using a chart. The chart is designed to be easy to read and understand.

Closing price chart:

Model quality rating chart:

Configuration

To run the Surfing Stock application, follow the steps below:

  1. Install Dependencies: Make sure you have the required dependencies installed in your environment. You can install them by running the following command:

    conda env export > environment.yml
  2. Download the Models: Download the models folder from the following link and move to ./gui/

  3. Run the Application: Once the dependencies are installed, you can run the application using the following command:

    python main.py

surfing-stock's People

Contributors

zeres-engel avatar

Stargazers

 avatar

Watchers

Kostas Georgiou avatar

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.