A golang implementation of a console-based trading bot for cryptocurrency exchanges

Overview

Listed on Awesome Go Develop Branch Build Status Godoc reference Last Release License Goreportcard

Golang Crypto Trading Bot

A golang implementation of a console-based trading bot for cryptocurrency exchanges.

Usage

Download a release or directly build the code from this repository.

go get github.com/saniales/golang-crypto-trading-bot

If you need to, you can create a strategy and bind it to the bot:

import bot "github.com/saniales/golang-crypto-trading-bot/cmd"

func main() {
    bot.AddCustomStrategy(examples.MyStrategy)
    bot.Execute()
}

For strategy reference see the Godoc documentation.

Simulation Mode

If enabled, the bot will do paper trading, as it will execute fake orders in a sandbox environment.

A Fake balance for each coin must be specified for each exchange if simulation mode is enabled.

Supported Exchanges

Exchange Name REST Supported Websocket Support
Bittrex Yes No
Poloniex Yes Yes
Kraken Yes (no withdraw) No
Bitfinex Yes Yes
Binance Yes Yes
Kucoin Yes No
HitBtc Yes Yes

Configuration file template

Create a configuration file from this example or run the init command of the compiled executable.

simulation_mode: true # if you want to enable simulation mode.
exchange_configs:
  - exchange: bitfinex
    public_key: bitfinex_public_key
    secret_key: bitfinex_secret_key
    deposit_addresses:
      BTC: bitfinex_deposit_address_btc
      ETH: bitfinex_deposit_address_eth
      ZEC: bitfinex_deposit_address_zec
    fake_balances: # used only if simulation mode is enabled, can be omitted if not enabled.
      BTC: 100
      ETH: 100
      ZEC: 100
      ETC: 100
  - exchange: hitbtc
    public_key: hitbtc_public_key
    secret_key: hitbtc_secret_key
    deposit_addresses:
      BTC : hitbtc_deposit_address_btc
      ETH: hitbtc_deposit_address_eth
      ZEC: hitbtc_deposit_address_zec
    fake_balances:
      BTC: 100
      ETH: 100
      ZEC: 100
      ETC: 100
strategies:
  - strategy: strategy_name
    markets:
      - market: ETH-BTC
        bindings:
        - exchange: bitfinex
          market_name: ETHBTC
        - exchange: hitbtc
          market_name: ETHBTC
      - market: ZEC-BTC
        bindings:
        - exchange: bitfinex
          market_name: ZECBTC
        - exchange: hitbtc
          market_name: ZECBTC
      - market: ETC-BTC
        bindings:
        - exchange: bitfinex
          market_name: ETCBTC
        - exchange: hitbtc
          market_name: ETCBTC

Donate

Feel free to donate:

METHOD ADDRESS
Paypal https://paypal.me/AlessandroSanino
BTC 1DVgmv6jkUiGrnuEv1swdGRyhQsZjX9MT3
XVG DFstPiWFXjX8UCyUCxfeVpk6JkgaLBSNvS
ETH 0x2fe7bd8a41e91e9284aada0055dbb15ecececf02
USDT 18obCEVmbT6MHXDcPoFwnUuCmkttLbK5Xo
Issues
  • new way to start with a new strategy

    new way to start with a new strategy

    I found a bit complicated to copy and paste every strategy into main.go and I think this is a simpler solution when the moment of switching strategies comes.

    I basically moved the examples of every type of strategy to a new package examples and, instead having to copy and paste the available strategies into main.go

    var myStrategy = WebsocketStrategy{...} // old way
    bot.AddCustomStrategy(myStrategy)
    

    we define now the strategies in the examples package as functions

    func MyStrategy() strategies.Strategy {...}
    

    and the ones we need to have available are added in main.go

    bot.AddCustomStrategy(examples.MyStrategy()) // new way
    
    enhancement 
    opened by marioarranzr 9
  • wrapper.api.NewBookTickerService undefined and wrapper.api.NewPriceChangeStatsService undefined

    wrapper.api.NewBookTickerService undefined and wrapper.api.NewPriceChangeStatsService undefined

    Hello!

    I can't compile app.

    golang/src/github.com/saniales/golang-crypto-trading-bot/exchanges/binance.go:191:35: wrapper.api.NewBookTickerService undefined (type *binance.Client has no field or method NewBookTickerService) golang/src/github.com/saniales/golang-crypto-trading-bot/exchanges/binance.go:209:37: wrapper.api.NewPriceChangeStatsService undefined (type *binance.Client has no field or method NewPriceChangeStatsService)

    Can you fix it?

    bug help wanted 
    opened by Megavolv 5
  • add some methods to exchange Coinbase

    add some methods to exchange Coinbase

    enhancement 
    opened by khigor777 3
  • New way to use a strategy

    New way to use a strategy

    I found a bit complicated to copy and paste the example into main.go and I think with this is a simpler solution to switch strategies.

    Congrats, you are doing a really good job!

    opened by marioarranzr 3
  • Test Strategy

    Test Strategy

    Hi,

    I would like to know if there Watch5Sec strategy should work for default? I had been trying to configure it in my config for testing and it is not working, the bot says the strategy does not exist. Do I need to add my own in the code?

    thanks in advance

    opened by alebeta90 3
  • will there be Bithumb support in near future?

    will there be Bithumb support in near future?

    will there be Bithumb support in near future?

    question 
    opened by LeeBlues 2
  • go mod tidy

    go mod tidy

    Hi, I just run "go mod tidy" to fix the dependency problem, maybe it may fix https://github.com/saniales/golang-crypto-trading-bot/issues/103

    opened by SunRunAwayAwayAway 2
  • Add a wiki system to explain how to use the bot

    Add a wiki system to explain how to use the bot

    enhancement 
    opened by saniales 2
  • Orderbook is not always sorted the right way

    Orderbook is not always sorted the right way

    see attached file On some exchanges we have correct on other we have wrong ordering

    bug 
    opened by saniales 2
  • Implement Kucoin Websockets

    Implement Kucoin Websockets

    Kucoin merged with #66 miss websocket support, add it

    enhancement 
    opened by saniales 0
  • Support Basic order triggers (CLOSED, PARTIALLY FILLED, ETC...)

    Support Basic order triggers (CLOSED, PARTIALLY FILLED, ETC...)

    this would be supported only on websocket mode, since polling would bring 429 error almost immediatly (assuming cap = 60 req/min, which is what most exchanges have as rate limit)

    enhancement help wanted 
    opened by saniales 0
  • Get Order status

    Get Order status

    The bot should be able to know order status (eg. if an order is still open or is closed)

    enhancement help wanted 
    opened by saniales 2
  • Support for Coinbase Pro API

    Support for Coinbase Pro API

    enhancement help wanted 
    opened by saniales 3
  • Support for external logging

    Support for external logging

    It should be possible to attach a logger to the bot

    enhancement help wanted 
    opened by saniales 0
  • Support for Gemini Exchange

    Support for Gemini Exchange

    Go Wrapper https://github.com/jsgoyette/gemini

    API Definition https://docs.gemini.com/rest-api/

    enhancement 
    opened by saniales 0
  • Support for BitMEX API

    Support for BitMEX API

    https://www.bitmex.com/api/explorer/

    Go Wrappers :

    • https://github.com/BitMEX/api-connectors/tree/master/auto-generated/go
    • https://github.com/qct/bitmex-go
    • https://github.com/santacruz123/bitmex-go
    enhancement on-hold 
    opened by saniales 0
  • Support for Coinigy API

    Support for Coinigy API

    http://docs.coinigy.apiary.io/ This will allow the bot to work with many exchanges with only a single interface. The title is very self-explanatory - take their 30 day trial and see if you like what you can do with it.

    help wanted 
    opened by m-roberts 0
  • Support for YoBit API

    Support for YoBit API

    help wanted on-hold 
    opened by saniales 0
  • cancel orders

    cancel orders

    the bot should be able to cancel orders

    help wanted 
    opened by saniales 3
Releases(v0.0.2-alpha)
  • v0.0.2-alpha(Nov 5, 2018)

    • Added new exchanges (kucoin, hitbtc, ...)
    • Added websocket support for some exchanges (bitfinex, binance, hitbtc)
    • Changed strategyFunc signature to match multiple markets and multiple exchanges.
    • Optimized handling by caching intermediate values
    • Support for hybrid REST/Websocket strategy
    • Simulation mode added
    • Changed format of config file to allow much more features
    • Added wiki first version ;)

    NOT PRODUCTION READY

    Source code(tar.gz)
    Source code(zip)
  • v0.0.1-alpha(Jul 20, 2018)

    First alpha release. NOT PRODUCTION READY. Comes with the currently built strategies.

    • IntervalStrategy (Calls OnUpdate every interval)
    • WatchStrategy (Prints info about a specified market, in config file)
    Source code(tar.gz)
    Source code(zip)
Owner
Alessandro Sanino
CTO at The Tryvium Company | Syscoin Community Developer | Blockchain Researcher | Blockchain Developer and Architect
Alessandro Sanino
IRC, Slack, Telegram and RocketChat bot written in go

go-bot IRC, Slack & Telegram bot written in Go using go-ircevent for IRC connectivity, nlopes/slack for Slack and Syfaro/telegram-bot-api for Telegram

null 686 Jul 17, 2021
A golang implementation of a console-based trading bot for cryptocurrency exchanges

Golang Crypto Trading Bot A golang implementation of a console-based trading bot for cryptocurrency exchanges. Usage Download a release or directly bu

Alessandro Sanino 574 Jul 22, 2021
Slack Bot Framework

slacker Built on top of the Slack API github.com/slack-go/slack with the idea to simplify the Real-Time Messaging feature to easily create Slack Bots,

Raed Shomali 536 Jul 23, 2021
Telegram Bot Framework for Go

Margelet Telegram Bot Framework for Go is based on telegram-bot-api It uses Redis to store it's states, configs and so on. Any low-level interactions

Gleb Sinyavskiy 62 Jul 15, 2021
The modern cryptocurrency trading bot written in Go.

bbgo A trading bot framework written in Go. The name bbgo comes from the BB8 bot in the Star Wars movie. aka Buy BitCoin Go! Current Status Features E

Yo-An Lin 331 Jul 24, 2021
easy-peasy wg tg bot

wireguard-telegram-bot Simple-Dimple Telegram Bot for Wireguard VPN config generation Functionality /menu — list available commands /newkeys — create

Sergey Skaredov 12 Jun 7, 2021
Buy crypto low/Sell high on Binance. Simple, powerful configuration, trade multiple assets simultaneously, single binary deployment with no external dependencies!

bnc-trading-bot Download the latest release for your OS This bot automatically trades crypto / fiat assets on Binance.com according to simple, configu

Matej Ľach 5 Jul 19, 2021
Flexible message router add-on for go-telegram-bot-api library.

telemux Flexible message router add-on for go-telegram-bot-api library. Table of contents Motivation Features Minimal example Documentation Changelog

Andrew Dunai 12 Jul 20, 2021
Chatto is a minimal chatbot framework in Go.

chatto Simple chatbot framework written in Go, with configurations in YAML. The aim of this project is to create very simple text-based chatbots using

Jaime Tenorio 88 Jul 12, 2021
Golang bindings for the Telegram Bot API

Golang bindings for the Telegram Bot API All methods are fairly self explanatory, and reading the godoc page should explain everything. If something i

null 3k Jul 23, 2021
A fast cryptocurrency trading bot implemented in Go

A fast cryptocurrency bot framework implemented in Go. Ninjabot permits users to create and test custom strategies for spot markets. ⚠️ Caution: Worki

Rodrigo Brito 823 Jul 21, 2021
Bot that polls activity API for Github organisation and pushes updates to Telegram.

git-telegram-bot Telegram bot for notifying org events Requirements (for building) Go version 1.16.x Setup If you don't have a telegram bot token yet,

Skycoin 3 May 13, 2021
CryptoPump is a cryptocurrency trading bot that focuses on high speed and flexibility

CryptoPump is a cryptocurrency trading bot that focuses on high speed and flexibility. The algorithms utilize Go Language and WebSockets to react in real-time to market movements based on Bollinger statistical analysis and pre-defined profit margins.

null 5 Jul 19, 2021
A telegram bot that fetches multiple RSS cryptocurrency news feeds for sentiment analysis

Crypto News Telegram Bot A simple telegram bot that will help you stay updated on your latest crypto news This bot will help you keep track of the lat

Cha 4 May 11, 2021