Skip to content

Cryptocurrency trading bot that uses an LSTM to predict price trends

Notifications You must be signed in to change notification settings

ssatia/cointreau

Repository files navigation

cointreau

Cointreau is a cryptocurrency trading bot that collects market data, predicts price trends using an LSTM, and makes trades using the GDAX API.

Components

Cointreau Design

collector.py: The collector collects historical market candle data using the GDAX API and stores the collected data in data/.

trainer.py: Trainer pulls the historical data and trains an LSTM model using a set of configurable parameters. Upon completion of training, the model is stored in model\ (by default).

trader.py: The trader pulls an LSTM model (most recently trained model in model\ by default), provides it with market data for the last sequence_length minutes, and produces predictions for each cryptocurrency. It then calls trade.py in order of magnitude of predicted change for each product.

trade.py: Places a limit buy/sell order for the product if the prediction is above/below the BUY_CONFIDENCE_THRESHOLD/SELL_CONFIDENCE_THRESHOLD.

Installation

trade.py uses an api_access_data.py file that stores the GDAX API key/secret, local MySQL DB user/pass and the local InfluxDB user/pass.

Create a file locally with the following format, fill in the relevant fields and save the file as api_access_data.py:

GDAX_PASSPHRASE = ''
GDAX_API_KEY = ''
GDAX_API_SECRET = ''

MYSQL_USER = ''
MYSQL_PASSWD = ''

INFLUXDB_USER = ''
INFLUXDB_PASS = ''

trader.py and trade.py also use a local MySQL DB and InfluxDB database named 'cointreau' with tables that store performance metrics, bankroll, pending and executed orders. These databases and tables can be created automatically using the db_setup shell script by running the following command:

sh db_setup.sh

Note: This script assumes that MySQL and InfluxDB are already installed locally.

Results

TODO: Add model testing perf and Grafana trading performance metrics after I get the combined model working.

About

Cryptocurrency trading bot that uses an LSTM to predict price trends

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published