Code Monkey home page Code Monkey logo

ashishpapanai / stockdl Goto Github PK

View Code? Open in Web Editor NEW
28.0 4.0 12.0 48.03 MB

A financial deep learning library for stocks price prediction and comparison with traditional investment strategies. The Library is based on LSTM-Neural Networks and Conv1D + LSTM Neural Networks. Investments are subject to market risks, The AUTHOR HOLDS NO RESPONSIBILITY for any financial loss.

Home Page: https://stockdl.readthedocs.io/en/latest/

License: Other

Python 100.00%
finace financial-analysis stocks stocks-api stocks-predictor pip python3 deep-learning lstm pip-package

stockdl's Introduction

DOI PyPI version Downloads Documentation Status

Stock (1)

stockDL: A Deep Learning library for stocks price predictions and calculations

Features

  • Single stock trading and price comparisons based on 2 traditional stock market algorithms [Buy and Hold & Moving Average], and 2 deep learning algorithms [LSTM Network and Conv1D + LSTM Network]
  • Returns result in JSON format comprising the Total Gross Yield, Annual Gross Yield, Total Net Yield, and Annual Net Yield. This JSON Result can be used for web-based price predictions. Considering the broker commission and capital gains tax in India [can be modified]
  • Dynamic model training every time the library is run thus making the model unaffected by unusual stock market changes due to Act of God, Pandemics, Sudden loss, Gains to the share prices.
  • Latest Financial Data collection from Yahoo Finance API (from the starting date of the stock to the current data).
  • Easy backend integration with flask or another python backend for web deployment.
  • Less than 90 seconds result processing time on Tesla K80 GPU with 4992 NVIDIA CUDA and 24 GB VRAM. Much faster than other deep learning stocks analysers. [can be used on Google Colab]
  • Easy Installation with pip. Install and run. Dependencies satisfied automatically.
  • Different plots available according to the user requirements, Plots to show the training and validation accuracy, Months to trade in the market and months to stay out, comparison of the 4 trading strategies and the market predictions for the coming month.

How to install:

For using as a library:

pip install stockDL

import the package as:

import stockDL

to get the results in command line:

from stockDL import main
main.Main('stock_ticker')

Stock tickers can be obtained here.

For using as a template or to make contributions to the repository:

Clone from GitHub: https://github.com/ashishpapanai/stockDL

git clone https://github.com/ashishpapanai/stockDL

Create a virtual environment using pip for Linux and macOS:

python3 -m pip install --user virtualenv
# Create a virtual environment
python3 -m venv env
# Activate the virtual environment
source env/bin/activate

Create a virtual environment using pip for Windows:

py -m pip install --user virtualenv
# Create a virtual environment
py -m venv env
# Activate the virtual environment
.\env\Scripts\activate

Installing dependencies:

pip install -r requirements.txt

Running the package:

python -m stockDL

Dependencies:

  1. Yahoo Finance (yfinance): https://pypi.org/project/yfinance/
  2. Keras: https://pypi.org/project/Keras/
  3. Pandas: https://pypi.org/project/pandas/
  4. Numpy: https://pypi.org/project/numpy/
  5. Matplotlib: https://pypi.org/project/matplotlib/
  6. TensorFlow: https://pypi.org/project/tensorflow/

Install all dependencies in a go: pip install -r requirements.txt If it fails: Install all dependencies on by one [if you are cloning the repository]. for pip installation, dependencies are satisfied automatically.

License:

MIT License © Ashish Papanai 2021

Documentation:

Read the documentation here

Getting Help:

Post your questions in the discussion section of the GitHub repository or mail the author [[email protected]]

Contributing to stockDL:

Contributions are not restricted to bug fixes or enhancements. We welcome contributions including any grammatical or typo error anywhere in the repository.

You can contribute by reviewing the PRs, requesting new and useful features, reporting a bug in the repository or helping the community in the discussion section.

Copyright © Ashish Papanai 2021

stockdl's People

Contributors

ashishpapanai avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

stockdl's Issues

new

My name is Luis, I'm a big-data machine-learning developer, I'm a fan of your work, and I usually check your updates.

I was afraid that my savings would be eaten by inflation. I have created a powerful tool that based on past technical patterns (volatility, moving averages, statistics, trends, candlesticks, support and resistance, stock index indicators).
All the ones you know (RSI, MACD, STOCH, Bolinger Bands, SMA, DEMARK, Japanese candlesticks, ichimoku, fibonacci, williansR, balance of power, murrey math, etc) and more than 200 others.

The tool creates prediction models of correct trading points (buy signal and sell signal, every stock is good traded in time and direction).
For this I have used big data tools like pandas python, stock market libraries like: tablib, TAcharts ,pandas_ta... For data collection and calculation.
And powerful machine-learning libraries such as: Sklearn.RandomForest , Sklearn.GradientBoosting, XGBoost, Google TensorFlow and Google TensorFlow LSTM.

With the models trained with the selection of the best technical indicators, the tool is able to predict trading points (where to buy, where to sell) and send real-time alerts to Telegram or Mail. The points are calculated based on the learning of the correct trading points of the last 2 years (including the change to bear market after the rate hike).

I think it could be useful to you, to improve, I would like to share it with you, and if you are interested in improving and collaborating I am also willing, and if not file it in the box.

If tou want, Please read the readme , and in case of any problem you can contact me ,
If you are convinced try to install it with the documentation.
https://github.com/Leci37/stocks-Machine-learning-RealTime-telegram/tree/develop I appreciate the feedback

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.