Giter Club home page Giter Club logo

gdax-tradingbot's Introduction

GDAX Tradingbot

An automated GDAX trading bot built in Python.

The bot uses a simple exponential moving average (EMA) crossover strategy to attempt to profit from short-term upwards trends in cryptocurrency. A buy/sell signal is triggered when the 5-period EMA and the 20-period EMA intercept. The bot uses the GDAX platform to buy/sell cryptocurrency, accessed via the official API.

The exit strategy of the bot is straightforward. Once a buy order has been fulfilled, the bot waits for either the price to change +40 basis points or for the EMAs to intercept. The first event to occur triggers the bot to sell the position.

The bot creates orders that only provide liquidity to the market and thus are market 'maker' orders. The significance of this is that GDAX currently charges 0% on fees for 'maker' orders1.

The project uses Threads to perform separate functions:

  • Grab live price, calculate EMAs and identify if a crossover has occurred
  • Perform a trading action - buy/sell depending on crossover

As the bot runs, all prices and transactions are logged into separate CSV files.

Use at your own risk.

Please Note - As of Oct 2018, this project is no longer maintained

1: 01/2018 GDAX Fees

Getting Started

These instructions allow you to get running and customise the project.

Prerequisites

You will need a GDAX account and an API key. Create a config file (config.py) in the root directory with the following format:

API_KEY = ""
API_SECRET = ""
API_PASS = ""
API_URL = "https://api.gdax.com/" #Sandbox: https://api-public.sandbox.gdax.com

The project was built and tested with Python 3.6.4. To install the required packages, run the following:

pip install -r requirements.txt

Customisation

To customise the project you can edit the following variables, as shown in example.py:

LOOP_DURATION = 58.5 # Time period (in seconds)
MAX_LOOP_TIME = 8 * 60 * 60 # Max duration to run (in seconds)
QUOTE_CURRENCY = "BTC" # Cryptocurrency of choice
BASE_CURRENCY = "EUR" # Fiat currency of choice
CSV_PRICE = "price.csv" # Price CSV name
CSV_TRANSACTIONS = "transactions.csv" # Transaction CSV name

Authors

  • Calum McGuicken

License

This project is licensed under the MIT License

Acknowledgments

gdax-tradingbot's People

Contributors

calum-mcg avatar garsaud 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

Watchers

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

gdax-tradingbot's Issues

Is this a bug?

in functions.py

under

    def buy(self, product_id, CoinBase, base_currency):
        balance = float(balance) * 0.1

I removed the * 0.1

Memory leak?

Hi, there seems memory leaks when using requests in threads. Memory used by requests to get orderbook at each cycle was not cleared after usage. Can you replace requests with urllib?

Size too small

Hallo,
I trying the code now, but look like there is a problem with the fee. The message I had is:
'size is too small. Minimum size is 0.01'
I will try to fix it and I let you know.

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.