Giter Site home page Giter Site logo

stockpriceprediction's Introduction

Stock Price Prediction

A machine learning project that predicts sotck price in the future.
It's a course project of CSIT 600D Introduction to Big Data, HKUST, 2017.

Prerequisites

Machine learning part

In brief, this a regression problem(supervised learning) in machine learing.

Input

Raw data is preprocessed as TP Matrix format.

Model

Convolutional Neural Networks is used to fit the labeled data.

Output

The CNNs gives a predicted stock price change ratio accroding to each input.

Backtesting part

For one single stock, we train a specific model.
On the morning of each trading day, we use the model to predict.

  • If the output is large enough(positive), we buy an amount of stock.
  • If the ouput is small enough(negative), we sell an amount of stock.
  • Otherwise, we just take the "hold" action.

Results

Three models are trained for three different stocks. The machine learning results and backtesting results are shown below:

Apple Inc. (AAPL)

  • Machine learning result for both train set and test set; Blue lines stand for ground truth and green stars for predictions.

  • Backtesting results

General Electric Company (GE)

  • Machine learning result for both train set and test set.

  • Backtesting results

The Boeing Company (BA)

  • Machine learning result for both train set and test set.

  • Backtesting results

As we can see, backtesting works fine on the first two stocks but doesn't on the third one.

Future work

Till now, this project is just a demo built for course. And we've listed some needed improvements:

  • Try different kinds of inputs
    • Involve more information besides raw stock price
  • Use data mining to find the threshold of trading
    • Threshold for buying
    • Threshold for selling
  • Keep modifying model parameters
    • The depth of networks
    • The number of neurons of each layers
    • Learning rate
    • ...
  • Try more models
    • RNN and LSTM are both good at sovling time series problems.
  • Try classification methods on this problem
    • Predict “rise” or “fall” of stock price

Author

HAN, Siyuan / @SiYuanHan
LI, Jianda / @jiandaLi
HU, Xiaoyu / @HuXiaoyu1994
YANG, Austin Liu / @AustinNeverPee

stockpriceprediction's People

Contributors

austinneverpee avatar jiandali avatar siyuanhan 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.