Git Product home page Git Product logo

stock_prediction's Introduction

Stock Predictor and Portfolio Optimizer

A novice's attempt for (weekly) stock prices prediction and portfolio optimization.

Technologies used -

  • Python 3
  • Scipy
  • Scikit-learn
  • matplotlib

Data Source

Major Features

  • Prediction of stock prices on weekly basis (predicting next week's prices for a given stock)
  • Optimizing portfolio distributions ( optimum ratio of each stock in a portfolio to potentialy maximize profits )

Algorithms and implementation mechanisms

  • Weekly prediction is being done using KNN Regressor using "Bollinger Band Value" and "Simple Moving Average" as input features.
  • Stock porfolio optimizer is done for maximizing the "Sharpe Ratio" or "culumative returns", using scipy minimizer (minimizing for -1 * value)

How to run?

  • predictorWeekly.py is a weekly stock prices predictor.
  • optimizer.py is a portfolio optimizer.
  • To run, install python 3 with pip, and then simply install all the libraries mentioned in the script file that you are trying to run, for e.g. pip install pandas
  • Once done, you can just run these like any other python script.
  • Data is already added in the repository under backend/data folder.

Testing and results

  • This application has been tested for National Stock Exchange, India. The weekly predictions have upto 75 % corelation with the actual results, for the leading (largest market capitalization) stocks.

TODO

  • Add all dependancies in requirements.txt
  • Creating web services
  • Creating Web-based front-end.
  • Improving accuracy by adding more Fundamental and Technical features

Notes

  • As I've mentioned, this implementation is at early stage. If you are an Machine Learning or Stock Market Enthusiast / Expert, feel free to suggest improvements / corrections by creating an issue (or you contact me at [email protected] )
  • As I have beginner-level skillset in Python programming language, I might have missed many of the best practices and architectural patterns specific to Python ecosystem, please feel free to suggest some improvements.
  • This application was part of my academic project coursework (Major Project, Engineering Final Year, Information Technology)

Credits

stock_prediction's People

Contributors

vishwajeetv avatar

Watchers

James Cloos 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.