฿ Bitcoin trading bot with a real-time dashboard for Bitstamp.
฿ Bitcoin trading bot with a real-time dashboard for Bitstamp.
Cointrol is a Bitcoin trading bot and real-time dashboard for Bitstamp created by @jkbrzt.
Cointrol was created to automate Bitcoin speculation. Besides automated trading based on price change triggers and various trading strategies, it also provides a real-time updated dashboard for your Bitstamp account where you can see all your orders and transactions real-time updated (something Bitstamp lacks). The dashboard for a real-time updated overview can also be used standalone without letting Cointrol make any transactions.
Even though the original idea was to perhaps provide a fully-fledged hosted service, the system remained quite basic as it has only been used by its creator for a period of time in the winter of '13/'14 (when BTC price fluctuations were pretty insane). Some of the obvious limitations—all of which could easily be addressed—are:
Even though Cointrol has been used for real transactions, no guarantees are provided in terms of security, correctness, etc. (see LICENCE).
The system consists of the following components:
cointrol-tradercointrol-serverwebappThe server-side parts (cointrol-server + cointrol-trader) are written in Python 3 (3.3+ is required) and use a mixture of Django (models, admin) and Tornado (WebSockets, async IO). Other libraries that are used include sockjs-tornado, Django REST framework.
The single-page webapp is written in CoffeeScript, Sass, Handlebars and uses Backbone.js, Brunch, socksjs-client, Bootstrap.
Make sure you have the following software installed on your system:
cointrol-server & cointrol-trader…
# Install dependencies
sudo npm -g install bower
cd cointrol/webapp
npm install
bower install
# Build the app
brunch build
# Use `brunch watch` during development
. virtualenv/bin/activate
cointrol/manage.py createsuperuser
Go to https://www.bitstamp.net/account/security/api. Create a new key and configure permissions for it. Cointrol needs at least the following permissions:
Account balanceUser transactionsOpen ordersIf you want Cointrol make transactions for you, select two following permissions as well:
Buy limit orderSell limit orderDon't forget to activate the key by clicking "Activate" and confirming the email you receive from Bitstamp.
cointrol-servercointrol-server. virtualenv/bin/activate
cointrol-server
By default, it will run on http://localhost:8000. You can change the port with --port=<port>.
Use this convenient link to log in: http://localhost:8000/admin/login/?next=/ — the Django admin interface is used for authentication, and this link ensures redirection back to the app after signing you in.
Connection indicator colors explained:
Green: The web app has a WebSocket connection to cointrol-server, and have recently heard from cointrol-trader.
Amber: The web app has a WeSocket connection to cointrol-server, but
have not heard from cointrol-trader in a while.
Red: The web app couldn't establish WebSocket connection to cointrol-server.
cointrol-trader. virtualenv/bin/activate
cointrol-trader
Note, until trading is configured and the COINTROL_DO_TRADE settings set to True (covered in a later step), the trader won't make any transactions. It only pulls your data from Bitstamp to populate the dashboard view.
Until the following steps are completed and trading is explicitly enabled, Cointrol doesn't attempt to make any transaction on your behalf:
settings_dev module which disables them). Add COINTROL_DO_TRADE = True to your cointrol/cointrol/conf/settings_local.py.The settings is resolved in this order:
settings_local.pysettings_(prod|dev).py settings_defaults.pyDuring the installation process, you've created cointrol/cointrol/conf/settings_local.py which imports settings from the settings_dev.py file. All the settings are Django settings. The only non-Django settings is COINTROL_DO_TRADE (False in dev, True in prod). You can override any of the default settings in the settings_local.py file.
Besides settings_dev.py, the conf directory also has settings_prod.py, which is more suitable for production use. It defines logging configuration which makes messages of a level >= WARNING logged by the trader to be sent to you via email (e.g. when the trader places an order or there is an error). If you decide to use this settings file (by changing the import in settings_local.py to from .settings_prod import *, you'll have to configure at least DATABASES, ADMINS and SECRET_KEY as well in your in settings_local.py.
Jakub Roztocil
3NVcdcoXrBV7jKv7T3st6kQz7XdsPNUn34MIT. See LICENCE.
No open issues yet, or sync has not completed.