1 | # Gekko
|
2 |
|
3 | *The point is ladies and gentlemen that greed, for lack of a better word, is good.*
|
4 |
|
5 | ![Gordon Gekko](http://mikevanrossum.nl/static/gekko.jpg)
|
6 |
|
7 | -Gordon Gekko
|
8 |
|
9 | Gekko is a Bitcoin trading bot for popular exchanges written in javascript running on [nodejs](http://nodejs.org), 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.
|
10 |
|
11 | ## Main features
|
12 |
|
13 | Gekko uses technical analysis (only EMA at this moment) to determine when to enter or leave the market, at such a moment it can:
|
14 |
|
15 | * Advice on what you should do (for example per email).
|
16 | * Calculate the profits of all the advices so far.
|
17 | * Automatically trade.
|
18 |
|
19 | Gekko currently supports automatic trading at the following exchanges:
|
20 | * [Mt. Gox](https://mtgox.com/)
|
21 | * [BTC-e](https://btc-e.com/) (alpha stage)
|
22 | * [Bitstamp](https://bitstamp.net) (alpha stage)
|
23 |
|
24 | ## What?
|
25 |
|
26 | 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**.
|
27 |
|
28 | 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.
|
29 |
|
30 | 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](mailto:mike@mvr.me) or leave feedback in the [Gekko thread on the bitcointalk forum](https://bitcointalk.org/index.php?topic=209149.0).
|
31 |
|
32 | *Use Gekko at you own risk.*
|
33 |
|
34 | ## Install
|
35 |
|
36 | Windows users? Here is a [step-by-step guide](https://github.com/askmike/gekko/blob/master/docs/installing_gekko_on_windows.md) on how to get Gekko running.
|
37 |
|
38 | Gekko runs on [nodejs](http://nodejs.org/), once you have that installed you can either download all files in [a zip](https://github.com/askmike/gekko/archive/master.zip) or clone the repository via git:
|
39 |
|
40 | git clone git://github.com/askmike/gekko.git
|
41 | cd gekko
|
42 |
|
43 | You need to download Gekko's dependencies, which can easily be done with [npm](http://npmjs.org):
|
44 |
|
45 | npm install
|
46 |
|
47 | To change the settings, open up and edit [config.js](https://github.com/askmike/gekko/blob/master/config.js) to change the parameters. Check out doc on [Configuring Gekko](https://github.com/askmike/gekko/blob/master/docs/Configuring_gekko.md) where everything is explained in more detail.
|
48 |
|
49 | To run the bot you just have to start Gekko:
|
50 |
|
51 | node gekko
|
52 |
|
53 | You can also run Gekko silently, for examples on how to do this check out the [advanced features](https://github.com/askmike/gekko/blob/master/docs/Advanced_features.md).
|
54 |
|
55 | If you installed the bot via git you can easily fetch the latest updates by running:
|
56 |
|
57 | git pull && npm update
|
58 |
|
59 | ## What is Gekko doing?
|
60 |
|
61 | If you started Gekko it will remain open in your terminal and log out new information, for example:
|
62 |
|
63 | start time: 2013-05-19 23:17:38
|
64 |
|
65 | I'm gonna make you rich, Bud Fox.
|
66 | Let me show you some Exponential Moving Averages.
|
67 |
|
68 | 2013-06-02 18:21:15 (INFO): ADVICE is to HOLD @ 117.465 (0.132)
|
69 | 2013-06-02 18:21:15 (INFO): (PROFIT REPORT) original balance: 207.465 USD
|
70 | 2013-06-02 18:21:15 (INFO): (PROFIT REPORT) current balance: 217.465 USD
|
71 | 2013-06-02 18:21:15 (INFO): (PROFIT REPORT) profit: 10.000 USD (4.820%)
|
72 |
|
73 | After the first fetching, every new interval (in the [config](https://github.com/askmike/gekko/blob/master/config.js#L17)) Gekko will fetch new trade data, advice on what to do and give a profit report:
|
74 |
|
75 | ### Advice
|
76 |
|
77 | * HOLD means don't do anything, we are either not in a trend or the trend has not changed since last check.
|
78 | * BUY means the trend has changed to an uptrend, advice is to buy now so we can sell at the end of the trend.
|
79 | * 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.
|
80 |
|
81 | 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.
|
82 |
|
83 | ### Profit report
|
84 |
|
85 | 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.**
|
86 |
|
87 | *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).*
|
88 |
|
89 | ### Buying and selling
|
90 |
|
91 | If you configured Gekko to automatically sell on this information it will also log:
|
92 |
|
93 | * NOW going to BUY, when it is buying BTC.
|
94 | * NOW going to SELL, when it is selling BTC.
|
95 |
|
96 | ## Backtesting
|
97 |
|
98 | Gekko also supports backtesing strategies. For information on how to set Gekko up plase refer to [the document on backtesting](https://github.com/askmike/gekko/blob/master/docs/Backtesting.md).
|
99 |
|
100 | ## TODO
|
101 |
|
102 | * Add more exchanges (such as [bitfloor](https://npmjs.org/package/bitfloor), [campBX](https://npmjs.org/package/campbx)).
|
103 | * Store trade history in levelDB.
|
104 | * Add money management (so that the bot will only spend a start amount of X and the profits on top of X).
|
105 |
|
106 | ## Credits
|
107 |
|
108 | * The title is inspired by [Bateman](https://github.com/fearofcode/bateman).
|
109 | * This project is inspired by the [GoxTradingBot](https://github.com/virtimus/GoxTradingBot/) Chrome plugin (though no code is taken from it).
|
110 |
|
111 | ## Final
|
112 |
|
113 | If Gekko helped you in any way, you can always leave me a tip at (BTC) 13r1jyivitShUiv9FJvjLH7Nh1ZZptumwW
|
114 |
|
115 | ## License
|
116 |
|
117 | The MIT License (MIT)
|
118 |
|
119 | Copyright (c) 2013 Mike van Rossum <mike@mvr.me>
|
120 |
|
121 | Permission is hereby granted, free of charge, to any person obtaining a copy
|
122 | of this software and associated documentation files (the "Software"), to deal
|
123 | in the Software without restriction, including without limitation the rights
|
124 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
125 | copies of the Software, and to permit persons to whom the Software is
|
126 | furnished to do so, subject to the following conditions:
|
127 |
|
128 | The above copyright notice and this permission notice shall be included in
|
129 | all copies or substantial portions of the Software.
|
130 |
|
131 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
132 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
133 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
134 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
135 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
136 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
137 | THE SOFTWARE.
|