Git Product home page Git Product logo

bitbot's Introduction

#BitBot

BitBot is a Crypto-Currency trading bot and backtesting platform that connects to popular Bitcoin exchanges (Bitstamp, Kraken). It is written in javascript and runs on Node.JS.

BitBot is modular and supports multiple trading strategies / exchanges.

Supported Exchanges
  • Bitstamp
  • Kraken
  • BTC-E
Supported Indicators
  • MACD
  • PPO
  • PSAR

Dependencies

Installation

Make sure you have the latest Node.JS version and MongoDB installed.

Clone this repository to a folder of your liking and execute the following command: npm install

Pay close attention to the log messages of NPM (there shouldn't be any errors).

Upgrading

  • Overwrite your files with the latest versions from this repository
  • Compare you config.js file with the config.sample.js file to make sure there aren't any extra settings available
  • Run the following command: npm install

Configuration basics

Copy the config.sample.js file and name it config.js.

Fill in the config.js file with relevant information.

When running the bot initially make sure to run with real trading disabled:

config.tradingEnabled = false;

Choose an exchange you want to trade on in the exchangeSettings:

exchange: '',
// Options: (bitstamp, kraken, btce)

Pay close attention to the currencyPair settings:

currencyPair: {pair: '', asset: '', currency: ''},
// For Bitstamp just use {pair: 'XBTUSD', asset: 'XBT', currency: 'USD'}
// For Kraken look up the currency pairs in their API: https://api.kraken.com/0/public/AssetPairs
// Kraken Example: {pair: 'XXBTZEUR', asset: 'XXBT', currency: 'ZEUR'}
// For BTC-E look up the currency pairs in their API: https://btc-e.com/api/3/info
// BTC-E Example: {pair: 'BTC_USD', asset: 'BTC', currency: 'USD'}

Then fill in your API details:

config.apiSettings = {
	bitstamp: {clientId: 0, apiKey: '', secret: ''},
	kraken: {apiKey: '', secret: ''},
	btce: {apiKey: '', secret: ''}
};

Make sure you enter the correct connection string for your MongoDB instance:

config.mongoConnectionString = 'username:[email protected]/mydb';

If you have a local MongoDB install your connection string would probably look something like this:

config.mongoConnectionString = 'localhost/nameofyourchoosing';

By default you will see a lot of debugging information in the log file located in the logs folder, once you are sure that your bot is retrieving data change the debug setting to false:

config.debug = false;

These are the minimum required settings you need to get the bot started. All other settings are user preference and should be pretty self explanatory.

Indicator and CandleStickSize settings

These settings aren't part of the configuration basics as they heavily depend on user preference.

Please read up on the following articles to help you choose the settings that best fit your strategy:

As of version 0.7 BitBot now uses indicators as small plugins. You can create your own indicator by using the template in the indicators folder.

For examples on how to use this template, go have a look at one of the existing indicators in the indicators folder.

Backtester

The provided backtester simulates the settings you provided in config.js over a set of data. That set of data is the data you collected by running app.js over a period of time.

Before you run the backtester, make sure you configured the following items in your config.js file:

  • exchangeSettings
  • apiSettings
  • indicatorSettings
  • backTesting
    • initialAssetBalance
    • initialCurrencyBalance

The backtester needs access to your API settings to query your current trading fee. This will give you more accurate results when simulating.

Usage

To run BitBot, execute the following command in the folder where you installed BitBot:

node app.js

If you would like to simulate trading on your collected data, execute:

node app.js -b

If you would like to reset the initial balance (profit reports are based against this value), execute:

node app.js -rb

Remember the backtester simulates your trading strategy on the data you collected. So the longer you keep the bot (app.js) running, the more significant the results of the backtester.

Profitability

The provided trading algorithms are well known and documented on the internet (MACD, PPO, PSAR). I do not guarantee you will make any profit when using this bot... For better results, consider writing your own algorithm and share it with the community in a pull request :-).

FAQ

  • Q: I often receive invalid nonce / invalid signature errors when using Bitstamp, how do I fix that?
  • A: Generate a new API key on the Bitstamp website.

Donations

If you enjoyed using BitBot or would like to help me continue development of this bot, consider buying me a beer:
(BTC) 1BitBotSYYMAsn6c1AsrxWphWAGkNE6hmQ

bitbot's People

Contributors

5an1ty avatar

Watchers

James Cloos avatar Marian avatar

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.