All Projects β†’ achillesrasquinha β†’ Bulbea

achillesrasquinha / Bulbea

Licence: other
πŸ— 🐻 Deep Learning based Python Library for Stock Market Prediction and Modelling

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to Bulbea

Machine Learning And Ai In Trading
Applying Machine Learning and AI Algorithms applied to Trading for better performance and low Std.
Stars: ✭ 258 (-83.72%)
Mutual labels:  finance, quantitative-finance, quantitative-trading, prediction
Beibo
πŸ€– Predict the stock market with AI 用AIι’„ζ΅‹θ‚‘η₯¨εΈ‚εœΊ
Stars: ✭ 46 (-97.1%)
Mutual labels:  finance, stock-market, quantitative-finance
fhub
Python client for Finnhub API
Stars: ✭ 31 (-98.04%)
Mutual labels:  finance, stock-market, quantitative-finance
Strategems.jl
Quantitative systematic trading strategy development and backtesting in Julia
Stars: ✭ 106 (-93.31%)
Mutual labels:  finance, quantitative-finance, quantitative-trading
Stock Bot
An application that allows you to design and test your own stock trading algorithms in an attempt to beat the market.
Stars: ✭ 240 (-84.86%)
Mutual labels:  finance, stock-market, quantitative-finance
Trading Backtest
A stock backtesting engine written in modern Java. And a pairs trading (cointegration) strategy implementation using a bayesian kalman filter model
Stars: ✭ 247 (-84.42%)
Mutual labels:  finance, quantitative-finance, quantitative-trading
AutoTrader
A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading.
Stars: ✭ 227 (-85.68%)
Mutual labels:  finance, quantitative-finance, quantitative-trading
Turingtrader
The Open-Source Backtesting Engine/ Market Simulator by Bertram Solutions.
Stars: ✭ 132 (-91.67%)
Mutual labels:  finance, quantitative-finance, quantitative-trading
Quantdom
Python-based framework for backtesting trading strategies & analyzing financial markets [GUI ]
Stars: ✭ 449 (-71.67%)
Mutual labels:  finance, stock-market, quantitative-finance
Introneuralnetworks
Introducing neural networks to predict stock prices
Stars: ✭ 486 (-69.34%)
Mutual labels:  finance, quantitative-finance, prediction
Qlib
Qlib is an AI-oriented quantitative investment platform, which aims to realize the potential, empower the research, and create the value of AI technologies in quantitative investment. With Qlib, you can easily try your ideas to create better Quant investment strategies. An increasing number of SOTA Quant research works/papers are released in Qlib.
Stars: ✭ 7,582 (+378.36%)
Mutual labels:  finance, quantitative-finance, quantitative-trading
Finance
Here you can find all the quantitative finance algorithms that I've worked on and refined over the past year!
Stars: ✭ 194 (-87.76%)
Mutual labels:  finance, stock-market, quantitative-finance
Quant Notes
Quantitative Interview Preparation Guide, updated version here ==>
Stars: ✭ 180 (-88.64%)
Mutual labels:  finance, quantitative-finance, quantitative-trading
cira
Cira algorithmic trading made easy. A Façade library for simpler interaction with alpaca-trade-API from Alpaca Markets.
Stars: ✭ 21 (-98.68%)
Mutual labels:  finance, stock-market, quantitative-finance
Alpha Mind
quantitative security portfolio analysis. The analysis pipeline including data storage abstraction, alpha calculation, ML based alpha combining and portfolio calculation.
Stars: ✭ 171 (-89.21%)
Mutual labels:  finance, stock-market, quantitative-finance
QuoraBooks
A GitHub repo for Quant Finance resources
Stars: ✭ 17 (-98.93%)
Mutual labels:  finance, quantitative-finance, quantitative-trading
Financial Machine Learning
A curated list of practical financial machine learning tools and applications.
Stars: ✭ 2,172 (+37.03%)
Mutual labels:  finance, stock-market, quantitative-finance
Tradingstrategies
Algorithmic trading strategies
Stars: ✭ 120 (-92.43%)
Mutual labels:  finance, quantitative-finance, quantitative-trading
Awesome Quant
A curated list of insanely awesome libraries, packages and resources for Quants (Quantitative Finance)
Stars: ✭ 8,205 (+417.67%)
Mutual labels:  finance, quantitative-finance, quantitative-trading
Stock analysis for quant
Different Types of Stock Analysis in Python, R, Matlab, Excel, Power BI
Stars: ✭ 525 (-66.88%)
Mutual labels:  stock-market, quantitative-finance, quantitative-trading

bulbea

"Deep Learning based Python Library for Stock Market Prediction and Modelling."

Gitter Documentation Status

Table of Contents

Installation

Clone the git repository:

$ git clone https://github.com/achillesrasquinha/bulbea.git && cd bulbea

Install necessary dependencies

$ pip install -r requirements.txt

Go ahead and install as follows:

$ python setup.py install

You may have to install TensorFlow:

$ pip install tensorflow     # CPU
$ pip install tensorflow-gpu # GPU - Requires CUDA, CuDNN

Usage

1. Prediction

a. Loading

Create a share object.

>>> import bulbea as bb
>>> share = bb.Share('YAHOO', 'GOOGL')
>>> share.data
# Open        High         Low       Close      Volume  \
# Date                                                                     
# 2004-08-19   99.999999  104.059999   95.959998  100.339998  44659000.0   
# 2004-08-20  101.010005  109.079998  100.500002  108.310002  22834300.0   
# 2004-08-23  110.750003  113.479998  109.049999  109.399998  18256100.0   
# 2004-08-24  111.239999  111.599998  103.570003  104.870002  15247300.0   
# 2004-08-25  104.960000  108.000002  103.880003  106.000005   9188600.0
...
b. Preprocessing

Split your data set into training and testing sets.

>>> from bulbea.learn.evaluation import split
>>> Xtrain, Xtest, ytrain, ytest = split(share, 'Close', normalize = True)
c. Modelling
>>> import numpy as np
>>> Xtrain = np.reshape(Xtrain, (Xtrain.shape[0], Xtrain.shape[1], 1))
>>> Xtest  = np.reshape( Xtest, ( Xtest.shape[0],  Xtest.shape[1], 1))

>>> from bulbea.learn.models import RNN
>>> rnn = RNN([1, 100, 100, 1]) # number of neurons in each layer
>>> rnn.fit(Xtrain, ytrain)
# Epoch 1/10
# 1877/1877 [==============================] - 6s - loss: 0.0039
# Epoch 2/10
# 1877/1877 [==============================] - 6s - loss: 0.0019
...
d. Testing
>>> from sklearn.metrics import mean_squared_error
>>> p = rnn.predict(Xtest)
>>> mean_squared_error(ytest, p)
0.00042927869370525931
>>> import matplotlib.pyplot as pplt
>>> pplt.plot(ytest)
>>> pplt.plot(p)
>>> pplt.show()

2. Sentiment Analysis

Add your Twitter credentials to your environment variables.

export BULBEA_TWITTER_API_KEY="<YOUR_TWITTER_API_KEY>"
export BULBEA_TWITTER_API_SECRET="<YOUR_TWITTER_API_SECRET>"

export BULBEA_TWITTER_ACCESS_TOKEN="<YOUR_TWITTER_ACCESS_TOKEN>"
export BULBEA_TWITTER_ACCESS_TOKEN_SECRET="<YOUR_TWITTER_ACCESS_TOKEN_SECRET>"

And then,

>>> bb.sentiment(share)
0.07580128205128206

Documentation

Detailed documentation is available here.

Dependencies

  1. quandl
  2. keras
  3. tweepy
  4. textblob

License

This code has been released under the Apache 2.0 License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].