Release 2.0
The goal of this project is to provide an API that recommends Buy/Sell/Hold of Bitcoin at any given time to maximize profitability.
- Price prediction is here! Adapted Stocker class to predict Bitcoin price. Please see Stocker Prediction Usage.ipynb notebook found in this repository.
- Export flat files from sqlitedb to use in Tableau.
- Incorporate OHLCV (open, high, low, close,volume) trends with ML algorithm.
- You'll need Python 3.6 or later for running the project. Check your version with
python3 --version
- Clone repo to your development environment
git clone https://github.com/lauramayol/crypto_signal.git
- Install virtualenv
pip install virtualenv
- Change directory to project folder
cd crypto_signal
- Start virtualenv
virtualenv --python=/usr/local/bin/python3 env
- Run virtualenv
source env/bin/activate
- Install dependencies using pip
pip3 install -r requirements.txt
- Add Nomics Api Key to environment variables. Nomics
export NOMICS_API_KEY=YOUR_API_KEY
- Run development server
python crypto_signal/manage.py runserver
- Check http://127.0.0.1:8000/ on your browser.
Location | Endpoint |
---|---|
Root path | / |
Signal | /<simulation_id>/signal |
Load Bitcoin data | /load/nomics |
Load Google trends data | /load/trends |
Load Simulation list | /load/simulations |
Update candles foreign keys | /update/candles |
Update BUY/SELL signal | /update/<simulation_id>/signal |
Method | Endpoint | Query | Description | Examples |
---|---|---|---|---|
GET |
/ |
n/a |
Retrieves the current list of Simulations that can generate a signal. Reference this list to use the correct simulation_id with other methods. | / |
GET |
/<simulation_id>/signal |
?currency=BTC&date=yyyy-mm-dd |
Retrieves the Buy/Sell signal from specified simulation in database for given currency (currently only Bitcoin (BTC) available and historical date (Jan 2013-Oct 2018). | /1/signal?currency=BTC&date=2018-08-15 |
POST |
/load/nomics |
?currency=BTC&start=yyyy-mm-dd&end=yyyy-mm-dd |
Full load of candle (OLHCV metrics) from Nomics.com with given currency and start/end dates (optional). Currently defaulted to daily (1d) intervals and start/end is blank (all-time). | /load/nomics?currency=BTC&start=2018-01-01 |
POST |
/load/trends |
?currency=BTC |
Full load of Google trends Interest Over Time metrics using pytrends library. We are comparing the Google search terms "buy bitcoin" and "BTC USD" Worldwide, and pulling the daily data on 180-day interval starting with today down to 2013. | /load/trends?currency=BTC |
POST |
/load/simulations |
n/a |
Initial loading list of simulations from flat file. | /load/simulations |
PATCH |
/update/candles |
?currency=BTC |
Updates foreign key relationship of candle to trend model. | /update/candles?currency=BTC |
PATCH |
/update/<simulation_id>/signal |
?currency=BTC |
Updates BUY/SELL signal for each candle based on specified simulation. | /update/1/signal?currency=BTC |
- Issue Tracker: https://github.com/lauramayol/crypto_signal/issues
- Source Code: https://github.com/lauramayol/crypto_signal
If you are having issues, please let me know by posting on Issue Tracker.
Pre-Release
The goal of this project is to provide an API that recommends Buy/Sell/Hold of Bitcoin at any given time to maximize profitability.
Goal: re-create the example from Marc Howard's blog
BUY Signal:
1. BTC price difference closes more than $80 above the prior day’s close price.
2. Search terms of “Buy Bitcoin” to “BTC USD” ratio is higher than 35% (Google Trends).
SELL Signal:
When price and ratio do not meet BUY requirements.
- Get historical transaction data for Bitcoin.
- Get Google Trends data.
- Import data into database.
- Identify buy/sell based on parameters described in blog.
- Use Django to create API.
- Write api docs and publish.
- Switch to SQLite database for easier sharing.
- Use graphical analysis to see how well the current buy/sell recommendations are performing.
- Released Hindisght simulation (best case scenario).
- Home page created at root path that lists the simulations available and links to visualization.
- Adapt Stocker class to predict Bitcoin price. Please see Stocker Prediction Usage.ipynb notebook found in this repository.
- Incorporate OHLCV (open, high, low, close,volume) trends with ML algorithm.
- Explore other sources (ie. BitMEX, CCXT).
- Optimize existing parameters as needed (specifically, revise Google Trends and BTC price change thresholds).
- What other variables could play a part in Bitcoin price?
- Get live transactional and order book data.
- Schedule regular data refreshes on live server.
- Issue Tracker: https://github.com/lauramayol/crypto_signal/issues
- Source Code: https://github.com/lauramayol/crypto_signal