Giter VIP home page Giter VIP logo

real-time-stock-market-prediction-using-ensemble-dl-and-rainbow-dqn's Introduction

Real Time Stock Market Forecasting

This repository contains an implementation of ensemble deep learning models to forecast or predict stock price. We used Alpha Vantage API to pull stock data(open,high,low,close,volume) and scraped news headlines from inshorts to perform sentiment analysis.

The code and the images of this repository are free to use as regulated by the licence and subject to proper attribution:

Shah, Raj and Tambe, Ashutosh and Bhatt, Tej and Rote, Uday, Real-Time Stock Market Forecasting using Ensemble Deep Learning and Rainbow DQN. 
Available at SSRN: https://ssrn.com/abstract=3586788 or http://dx.doi.org/10.2139/ssrn.3586788.

Architecture

Getting Started

It would be a better idea to create a conda environment and work in isolation

  • Create a virtual environment
conda create -n envname python=3.6.8 anaconda 
conda activate envname

Use conda deactivate to deactivate the environment

  • Clone this repository
git clone --depth 1 https://github.com/THINK989/Real-Time-Stock-Market-Prediction-using-Ensemble-DL-and-Rainbow-DQN.git && cd Real-Time-Stock-Market-Prediction-using-Ensemble-DL-and-Rainbow-DQN
  • Install the requirements
pip install -r requirements.txt
  • Get an Alpha Vantage API key

To run animate.py you require a free Alpha Vantage API Key. Enter the key in key='' parameter inside the animate.py file

ts = TimeSeries(key='',output_format='pandas')
  • Run python script

To vizualize the forecast. Remember the data pulled by the API will not update the plot if the market is closed.

python animate.py

To get heatmap visualization for correlation analysis on ^NSEI(Nifty50)

python heatmap.py

License

This repository is distributed under MIT License

and

respective LICENSE under directories

forecast/LICENSE
or 
rainbow/LICENSE

for thier independent code usage.

Acknowledgements

real-time-stock-market-prediction-using-ensemble-dl-and-rainbow-dqn's People

Contributors

think989 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

real-time-stock-market-prediction-using-ensemble-dl-and-rainbow-dqn's Issues

New complementary tool

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.

invalid api call

hi , thanks for this repository ,I have type NSEI as stock and selt 5 min but there is an api call error, do you have any idea about this error, maybe I select wrong paramaters,

and can u give some informations about updates in trading-repository,which strategy/epsisode is best in your opinion

Stock to plot: NSEI
Enter the amount of interval among 1, 5, 15 and 30:-5
Currently Pulling NSEI
Traceback (most recent call last):
File "C:\Python38\lib\site-packages\matplotlib\cbook_init_.py", line 196, in process
func(*args, **kwargs)
File "C:\Python38\lib\site-packages\matplotlib\animation.py", line 951, in _start
self._init_draw()
File "C:\Python38\lib\site-packages\matplotlib\animation.py", line 1743, in _init_draw
self._draw_frame(next(self.new_frame_seq()))
File "C:\Python38\lib\site-packages\matplotlib\animation.py", line 1766, in _draw_frame
self._drawn_artists = self._func(framedata, *self._args)
File "C:/Users/ahmet/PycharmProjects/Real-Time-Stock-Market-Prediction-using-Ensemble-DL-and-Rainbow-DQN/animate.py", line 276, in animate
graphData(stock,10,50,interval)
File "C:/Users/ahmet/PycharmProjects/Real-Time-Stock-Market-Prediction-using-Ensemble-DL-and-Rainbow-DQN/animate.py", line 111, in graphData
data, meta_data = ts.get_intraday(symbol=stock,interval=str(interval)+'min')
File "C:\Python38\lib\site-packages\alpha_vantage\alphavantage.py", line 218, in _format_wrapper
call_response, data_key, meta_data_key = func(
File "C:\Python38\lib\site-packages\alpha_vantage\alphavantage.py", line 160, in _call_wrapper
return self._handle_api_call(url), data_key, meta_data_key
File "C:\Python38\lib\site-packages\alpha_vantage\alphavantage.py", line 337, in _handle_api_call
raise ValueError(json_response["Error Message"])
ValueError: Invalid API call. Please retry or visit the documentation (https://www.alphavantage.co/documentation/) for TIME_SERIES_INTRADAY.
Plot will update every 5 minutes
Stock to plot:

how can we get buy/sell signal

hi ,I have run animate.py but I think it is only for forecasiting, how can we catch buy and sell signal
I am not so good about python language ,can u help me please
I think we shoulld use train and eval.py for that right? or is there anyway to do this on animate.py

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.