Current Cloud Mining @ Cex.io

Thursday, January 2, 2014

Gekko Bitcoin Trading Bot

Gekko Bitcoin Trading Bot

CEX.IO - Mtgox - BTC-e - Bitstamp


Gekko is a Bitcoin trading bot for popular exchanges written in javascript running on nodejs, it will feature multiple trading methods using technical analysis (at this moment it only knows EMA). It can monitor the live market or backtest strategies on historical data.

I am not the creator of this, just spreading the knowledge of it.


Install the nodejs platform

Nodejs is required to run the gekko bot.  It can be downloaded here.  Once on the nodejs page you want to click the install button and download the file to your desktop.  Simply double click the installer once it’s downloaded and use the default settings to install.

Download the gekko repository

The next step is to actually download the gekko bot.  It is hosted on github so it is optimized for Linux, however you can download it as a zip file.  The gekko github is located here.  Download Zip is located on the right side column of the page.  Extract the file using your favorite zip file program.
 
Install the Bot

Next you want to install gekko’s dependencies.  This is fairly easy you just want to open a command prompt, the easiest way to do this is to go to the gekko folder you extracted hold shift and right click, then select open command window here.  This will prevent you from needing to change directories.  Once you have your command window open and pointing at your gekko folder just type: npm install.  This step will take a few minutes to complete as it has to download some files.

Configure for your platform (I prefer CEX.io)

This will be the longest section dedicated to configuring the gekko bot.  In a future post I may explain how to set it up for MtGox but it’s very similar so you guys might be able to figure it out for yourselves.  For making changes to the javascript files I recommend using Notepad++.  It’s a much better editor than the default notepad app and is free!  To get started you want to go to your gekko folder and locate the config.js file.

Right-click the config file and select “edit with notepad++”.  Here’s where it gets a little complicated.  Before you can configure for cex.io you need to get some unique codes called a key and a secret.  To do this log into your cex.io account and go to your profile.  Then, click the API tab.  You want to make sure all the boxes under Permissions are checked and then click Generate Key.

Go back to notepad++ where you have your config.js open.  The main portion we are concerned with to make the bot work is in the second block of code.  It’s under a comment that says //monitor the live market.  Within this section are a number of variables that can be changed.  Here is what you should place in each variable:

enabled: true,
exchange: ‘cexio’
currency: ‘BTC’,
asset: ‘GHS’,
tradingEnabled: true,
key: ‘The Key you generated on CEX should be pasted here’,
secret: ‘The Secret you generated should be pasted here’,
username: ‘your username’,

In the next block of code you can enable the bot to send email advice and enter your email address there.  If you do it this way you can set trading Enabled in the section above to false and do your buy and sell manually.

The last thing I will talk about is the EMA settings at the very top of the config file.  I cannot claim to be an expert on this as I haven’t really messed around with it too much.  I can tell you for sure that for a site like CEX.io you want your sell and buy triggers to be lower.  So you want to set the sell threshold and buy threshold to something like this:


sellTreshold: -0.0025,
buyTreshold: 0.0025


It can be a different number but this is a conservative one that won’t result in flipping the ghs too quickly.

Running the Bot

The last step is to actually run the bot.  To do this open a command window(shift + right-click in the gekko folder and select open command window here) and simply type: node gekko.  That’s it.  Easy as pie folks.  If you have any problems or questions you can ask them here.  Happy Trading!!

No comments:

Post a Comment