← 开源
jkbrzt

cointrol

฿ Bitcoin trading bot with a real-time dashboard for Bitstamp.

ApplicationsSpecialistsPython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
1.45k
Star
276
Fork
+1
本周
3
贡献者
创建于 2015-03-19 · 更新于 2026-10-15 · 今日第 10286 名
主要开发者
jkbrztbokubfederico123579

jkbrzt/cointrol 排名第 10,286,有 1,453 个星标。

同类别比较

jkbrzt/cointrol 排名第 10,286,此处有 8 个同类条目;InternScience/InternAgent 排名第 10,285。

同类别比较
名称排名指标
scraed/LanPaint10,274
语言:
Python
星标数:
1,458
分叉数:
54
简介:
High quality training free inpaint for every stable diffusion model. Supports ComfyUI
hotovo/aider-desk10,277
语言:
TypeScript
星标数:
1,457
分叉数:
129
简介:
Platform for AI-powered software engineers
11cafe/comfyui-workspace-manager10,281
语言:
TypeScript
星标数:
1,456
分叉数:
79
简介:
A ComfyUI workflows and models management extension to organize and manage all your workflows, models in one place. Seamlessly switch between workflows, as well as import, export workflows, reuse subworkflows, install models, browse your models in a single workspace
InternScience/InternAgent10,285
语言:
Python
星标数:
1,454
分叉数:
132
简介:
InternAgent-1.5: A Unified Agentic Framework for Long-Horizon Autonomous Scientific Discovery
nagisanzenin/engram10,288
语言:
Python
星标数:
1,452
分叉数:
108
wannabespace/conar10,290
语言:
TypeScript
星标数:
1,452
分叉数:
106
简介:
AI-powered tool for working with Postgres, MySQL, MSSQL and Clickhouse.
nod-ai/AMD-SHARK-Studio10,294
语言:
Python
星标数:
1,451
分叉数:
166
WSTxda/SwitchAI10,301
语言:
Kotlin
星标数:
1,449
分叉数:
63
简介:
Easily select, start, and manage your preferred AI digital assistants on Android.
关键参数与规格
关键参数与规格
参数值
语言Python
类别Applications
子类别Specialists
关键词Finance
星标数1,453
分叉数276
贡献者3
创建日期2015-03-19
更新日期2026-10-15
1 天星标数0
7 天星标数1
排名10,286
上次排名5,681
排名变化-4,605
7 天星标排名9,829
上次 7 天星标排名9,894
7 天星标排名变化65
总星标排名8,300
上次总星标排名8,289
总星标排名变化-11
README 摘录

Cointrol 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). Architecture The system consists of the following components: Polls various Bitstamp API endpoints Writes changes to DB Publishes changes to Redis pub/sub Opens orders, when suitable Serves Webapp static files Exposes DB

for Webapp via a REST API Forwards Redis pub/sub messages from Trader to Webapp via WebSocket Exposes Django administration that is currently used for managing trading sessions REST/WebSocket API-powered Single Page App Real-time updated overview on orders, transactions, and trading sessions Technology **The server-side parts** ( + ) 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. Prerequisites Make sure you have the following software installed on your system: Python 3. 2 Build the single-page app web client and install its dependencies 2. 1 Get API key and secret Go to Create a new key and configure permissions for it. Cointrol needs at least the following permissions: * If you want Cointrol make transactions for you, select two following permissions as

well: * Don't forget to activate the key by clicking "Activate" and confirming the email you receive from Bitstamp. 2 Configure Cointrol with the API credentials 1. Go to and enter your Bitstamp username as well as the API key and secret to the form there. Usage Start By default, it will run on You can change the port with . **Connection indicator colors explained:** Green: The web app has a WebSocket connection to , and *have* recently heard from . Amber: The web

app has a WeSocket connection to , but *have not* heard from in a while. Red: The web app couldn't establish WebSocket connection to . Start Note, until trading is configured and the settings set to (covered in a later step), the trader won't make any transactions. It only pulls your data from Bitstamp to populate the dashboard view. Trading Until the following steps are completed and trading is explicitly enabled, Cointrol doesn't attempt to make any transaction on your behalf: 1

. Through the admin ( you can create a trading strategy profile. It can be for the *fixed* (fixed price points in

常见问题

记录了多少星标和分叉?

jkbrzt/cointrol 有 1,453 个星标和 276 个分叉。

仓库排名是多少?

jkbrzt/cointrol 排名第 10,286。

记录的语言和类别是什么?

jkbrzt/cointrol 有 1,453 个星标,语言为 Python,类别为 Applications。

哪个仓库排名最接近?

jkbrzt/cointrol 与 InternScience/InternAgent 比较,后者排名第 10,285,有 1,454 个星标。

README

Cointrol

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:

  • Only basic trading strategies are implemented
  • Single user/Bitstamp account is supported
  • Only one active trading session at a time
  • The whole account value is used when trading
  • Django admin is used for auth and trading strategy/session manipulations

Even though Cointrol has been used for real transactions, no guarantees are provided in terms of security, correctness, etc. (see LICENCE).

Architecture

The system consists of the following components:

cointrol-trader

  • Polls various Bitstamp API endpoints
  • Writes changes to DB
  • Publishes changes to Redis pub/sub
  • Opens orders, when suitable

cointrol-server

  • Serves Webapp static files
  • Exposes DB for Webapp via a REST API
  • Forwards Redis pub/sub messages from Trader to Webapp via WebSocket
  • Exposes Django administration that is currently used for managing trading sessions

webapp

  • REST/WebSocket API-powered Single Page App
  • Real-time updated overview on orders, transactions, and trading sessions

Technology

The 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.

Installation

0. Prerequisites

Make sure you have the following software installed on your system:

  • Python 3.3+
  • Redis
  • npm

1. Install Cointrol

1.1 Install cointrol-server & cointrol-trader

mkdir Cointrol && cd Cointrol

# Create an isolated Python virtual environment
pip install virtualenv
virtualenv ./virtualenv --python=$(which python3)

# Activate the virtualenv
# IMPORTANT: it needs to be activated every time before you run
#            a manage.py or cointrol-* command.
. virtualenv/bin/activate

# Get the code
git clone https://github.com/jkbrzt/cointrol

# Create a local settings file
echo 'from .settings_dev import *' > cointrol/cointrol/conf/settings_local.py

# Install Python requirements
pip install -r cointrol/cointrol/conf/requirements.txt

# Initialize the database
cointrol/manage.py migrate

# Install cointrol-*
pip install -e ./cointrol

1.2 Build the single-page app web client and install its dependencies

# Install dependencies
sudo npm -g install bower
cd cointrol/webapp
npm install
bower install

# Build the app
brunch build

# Use `brunch watch` during development

2. Create a Django user

. virtualenv/bin/activate
cointrol/manage.py createsuperuser

3. Configure Bitstamp API access

3.1 Get API key and secret

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 balance
  • User transactions
  • Open orders

If you want Cointrol make transactions for you, select two following permissions as well:

  • Buy limit order
  • Sell limit order

Don't forget to activate the key by clicking "Activate" and confirming the email you receive from Bitstamp.

3.2 Configure Cointrol with the API credentials

  1. Activate the virtualenv and run cointrol-server
  2. Go to http://localhost:8000/admin/core/account/1/ and enter your Bitstamp username as well as the API key and secret to the form there.

Usage

Start cointrol-server

. virtualenv/bin/activate
cointrol-server

By default, it will run on http://localhost:8000. You can change the port with --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.

Start 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.

Trading

Until the following steps are completed and trading is explicitly enabled, Cointrol doesn't attempt to make any transaction on your behalf:

  1. Through the admin (http://localhost:8000/admin/) you can create a trading strategy profile. It can be for the fixed (fixed price points in USD are used as buy/sell triggers) or the relative (percentage of the initial BTC price are used) strategy.
  2. Create a trading session (also in the admin interface).
  3. To perform actual transactions, you'll have to enable them in the settings (we used the settings_dev module which disables them). Add COINTROL_DO_TRADE = True to your cointrol/cointrol/conf/settings_local.py.

Settings

The settings is resolved in this order:

  1. settings_local.py
  2. settings_(prod|dev).py
  3. settings_defaults.py
  4. Django defaults

During 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.

Contact

Jakub Roztocil

Licence

MIT. See LICENCE.

排名相邻
同类项目