Giter Club home page Giter Club logo

stock_surface's Introduction

Stock Surface - Machine Learning Algorithm To Predict Stock Direction

This module was motivated by a unique feature set I wanted to test.

Installation

git clone [repository] 

Running Code

cd stock_surface

#install the dependencies 
pip install -r /path/to/requirements.txt

#runing tests
pytest tests/

#get stock data and train a new model
python get_tickers.py

#look at how well model did for individual stock
pytest tests/test_plotting.py::test_plot_stock 

#check returns for whole portfolio 
pytest tests/test_backtest.py::test_on_array_of_tickers_profit

#open the csv file 
vi files/testing_files/return_output.csv

Useful Files

get_tickers.py

This file holds the main function that pulls the stock data, manipulates the feature set, and trains the model.

sample_slopes.py

This file holds the functions to perform the feature and target value manipulation on the stock data.

settings.py

Holds the settings for the back testing

support_vector.py_

This holds the class that's used for ML

plotly_web.py

Used for making a pretty 3D surface graph on Plotly

tests/test_plotting.py Used for inputting a stock ticker and having it make a graph of the algorithm's returns alongside the close prices and trade indicators.

tests/test_back_test.py

These functions are used to test how well your model did on the market data most notably: test_on_array_of_tickers_profit()

This will output a CSV file that you can compare how each stock did to just holding it.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

stock_surface's People

Contributors

jbamford 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.