The point is ladies and gentlemen that greed, for lack of a better word, is good.
-Gordon Gekko
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).
Gekko uses technical analysis (only EMA at this moment) to determine when to enter or leave the market, at such a moment it can:
- Advice on what you should do (for example per email).
- Calculate the profits of all the advices so far.
- Automatically trade.
Gekko currently supports automatic trading at the following exchanges:
This project is a learning excercise of me, a student with some experience in programming (mostly web) and zero experience in economics and trading. I figured writing my own trade bot would be the best way to learn about implementing mathematical trading algorithms. So here is my very first attempt at anything related to trading / algorithmic decision making.
I'm developing Gekko fully open source in the hope of getting feedback from folks with more experience in this field. Because I not only want to attract programmers I am doing my best to make the code as readable as possible, this includes a lot of comments and probably not the most efficient (but expressive) code.
As this is a learning experience for me all feedback is extremely appreciated. If you don't want to contribute to the code you can always just send me an email or leave feedback in the Gekko thread on the bitcointalk forum.
Use Gekko at you own risk.
Windows users? Here is a step-by-step guide on how to get Gekko running.
Gekko runs on nodejs, once you have that installed you can either download all files in a zip or clone the repository via git:
git clone git://github.com/askmike/gekko.git
cd gekko
You need to download Gekko's dependencies, which can easily be done with npm:
npm install
To change the settings, open up and edit config.js to change the parameters.
If you want to enable real trading (disabled by default) head to the danger zone of config.js and fill in your exchange, API keys and enable (Gekko only needs trade rights).
To run the bot you just have to start Gekko:
node gekko
If you installed the bot via git you can easily fetch the latest updates by running:
git pull && npm update
If you started Gekko it will remain open in your terminal and log out new information, for example:
start time: 2013-05-19 23:17:38
I'm gonna make you rich, Bud Fox.
Let me show you some Exponential Moving Averages.
(ADVICE) 2013-05-19 23:18:14 HOLD @ 122.596 (-0.140)
(PROFIT REPORT) 2013-05-19 23:18:14 0.000 % profit (in 0 trades)
After the first fetching, every new interval (in the config) Gekko will fetch new trade data, advice on what to do and give a profit report:
- HOLD means don't do anything, we are either not in a trend or the trend has not changed since last check.
- BUY means the trend has changed to an uptrend, advice is to buy now so we can sell at the end of the trend.
- SELL means the trend has chacnged to a downtrend, advice is to sell now so we can buy back at the end of the trend.
After every line of advice we can see the current price Gekko calculated and the difference in EMAs, this makes it easier to understand the advice.
The profit report will log out Gekko's profit since it started, this is done using a buy and sell simulations (regardless if you have automatic trading enabled or not). The profit does not take fees into account.
If Gekko logs 20% that means that if you would have had automatic trading enabled on an exchange account with a balance of 1BTC, you would now have 1.2BTC (minus the exchange fees for the trades).
If you configured Gekko to automatically sell on this information it will also log:
- NOW going to BUY, when it is buying BTC.
- NOW going to SELL, when it is selling BTC.
It will try to buy/sell 1000 BTC, Mt. Gox and BTC-e change this in to all the funds on your account (unless you're pretty rich).
- Create an easy way to backtest historical data and determine the effectiveness of different paramters.
- Keep record of balance and check wether auto orders are going through on markets without MKT orders (BTC-e and Bitstamp).
- Add more exchanges (such as bitfloor, campBX).
- Store trade history in levelDB.
- Add money management (so that the bot will only spend a start amount of X and the profits on top of X).
- The title is inspired by Bateman.
- This project is inspired by the GoxTradingBot Chrome plugin (though no code is taken from it).
If Gekko helped you in any way, you can always leave me a tip at (BTC) 1KyQdQ9ctjCrGjGRCWSBhPKcj5omy4gv5S
The MIT License (MIT)
Copyright (c) 2013 Mike van Rossum [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.