项目 / chrisleekr/binance-trading-bot

chrisleekr/binance-trading-bot

行业候选
语言 TypeScript标签 binancebinance-apitrading-botbinance-trading-botbinance-api-nodecryptocurrencycryptotradingbotgrid-tradingtraidingviewtechnical-analysis-indicatorsmcp数据更新 2026-11-25 06:49:28 · 仓库 2026-11-24

一段话介绍

Automated Binance trading bot with pluggable strategies, historical backtesting, a live dashboard, and connect an AI agent over MCP

本站整理,非 GitHub 官方 description。

官方 description(GitHub API 原样)
Automated Binance trading bot with pluggable strategies, historical backtesting, a live dashboard, and connect an AI agent over MCP
5,620累计星
1,166Fork
—峰值日增
0上榜次数
总榜
暂未入榜
日榜
暂未入榜
周榜
暂未入榜
月榜
暂未入榜

官方快照(gh_history.db,2026-11-25):总榜 未进 Top50 · 日榜 未进 Top50 · 周榜未满 7 天基线(官方不生成) · 月榜暂无官方口径;下方四卡为站内趋势聚合(周卡按上榜次数,非官方 7 日增量窗)。

行业与场景

按行业选型 →

量化研究与策略回测

适配系统:量化投研平台、行情终端 · 得分 2.8

内置行情接入、因子计算与回测框架,可作为投研团队的策略实验与绩效归因底座。

BI 可视化与自助分析

适配系统:BI/报表平台、自助分析平台 · 得分 1.2

提供图表渲染与自助取数能力,可作为业务看板与经营管理分析的展示层。

大模型应用工程化与评测

适配系统:AI 应用平台、模型评测平台 · 得分 1.2

提供模型接入、编排与效果评测能力,可作为行业 AI 应用的工程底座与质量闸门。

更多信息

以下三段按该项目自己的 GitHub README 章节摘录(可合理截断并标明);README 没有对应章节的留空,不编造。

我的用法
在自己服务器上运行并使用 API 密钥连接币安账户后,机器人会自动盯盘并代为下单:对每个监控币种循环执行读取行情、按策略规则判断买卖;每个账户可建多个 profile,各配币种、预算和策略,并可先用历史 K 线回放验证策略再实盘。
特点或设计要点
策略以独立包装提供,目前包括 trailing-trade、动量和再平衡,可按配置文件分别选用。一个操作者登录可对应多个账户,每个账户再运行多套互不干扰的配置。数据存储使用 Postgres 与 TimescaleDB,缓存和队列使用 Redis 与 BullMQ。也可按文档可选接入 MCP,供 AI 代理在同一套校验下读取账户和回测信息。完整说明见[项目文档](https://chrisleekr.github.io/binance-trading-bot)。
局限和适用边界
作者不对项目信息的准确性和完整性作任何担保,对由此产生的损失或索赔概不负责,使用风险自负。
星标走势还差一天的数据,明天就能看到曲线
每天 10:30 记一次星标,连续两天后自动生成曲线
首次发现 — · 最近在榜 2026-11-22 · 语言 TypeScript · 贡献者 —
agentmcp

GitHub 项目主页介绍

来自 GitHub 仓库 README / 主页介绍正文,原样摘录,共 8,589 字节。

<div align="center">

# Binance Trading Bot

**Automated Binance trading bot with pluggable strategies, historical backtesting, and a live dashboard.**<br/> Self-hosted. Multiple strategy profiles: grid, momentum, or rebalancing.

[Documentation](https://chrisleekr.github.io/binance-trading-bot) · [Quick start](#quick-start-development) · [Deploy](deploy/README.md) · [Strategies](https://chrisleekr.github.io/binance-trading-bot/concepts/strategies/)

[![CI](https://img.shields.io/github/actions/workflow/status/chrisleekr/binance-trading-bot/ci.yml?branch=main&label=CI)](https://github.com/chrisleekr/binance-trading-bot/actions/workflows/ci.yml) [![Docs](https://img.shields.io/github/actions/workflow/status/chrisleekr/binance-trading-bot/docs.yml?branch=main&label=docs)](https://chrisleekr.github.io/binance-trading-bot) [![Release](https://img.shields.io/github/v/release/chrisleekr/binance-trading-bot?sort=semver)](https://github.com/chrisleekr/binance-trading-bot/releases) [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)

[![Docker pulls](https://img.shields.io/docker/pulls/chrisleekr/binance-trading-bot)](https://hub.docker.com/r/chrisleekr/binance-trading-bot) [![Stars](https://img.shields.io/github/stars/chrisleekr/binance-trading-bot)](https://github.com/chrisleekr/binance-trading-bot/stargazers) [![Contributors](https://img.shields.io/github/contributors/chrisleekr/binance-trading-bot)](https://github.com/chrisleekr/binance-trading-bot/graphs/contributors)

<img src="docs/assets/readme/dashboard.png" alt="Dashboard showing open positions, open orders, market trend and the monitored symbol table" width="900" />

</div>

<!-- prettier-ignore -->
> [!WARNING]
> **I cannot guarantee whether you can make money or not. Use it at your own risk.** I have no responsibility for any loss or hardship incurred directly or indirectly by using this code. Read the [disclaimer](#disclaimer) before using it.
>
> Under active development and not recommended for real funds.

## How it works

You run the app on your own server, connect it to your Binance account with an API key, and it watches the market and places buy and sell orders on your behalf. Once running, it repeats a short loop for every coin you told it to watch: read the market, run your strategy's rules, decide buy / sell / wait, and act.

- **Strategy-pluggable.** A _strategy_ is the rulebook the bot trades by. Three ship today: **trailing-trade**, **momentum**, and **rebalance**, and you pick one per profile. Each lives in its own package behind a shared contract, so adding a fourth is mostly a new package plus a registry entry, not a rewrite of the trading loop.
- **Account-scoped profiles.** One operator login owns one or more Binance _accounts_. Each account is one API key pair, one environment (testnet or live), and one wallet. Each account runs N independent _profiles_, each with its own coins, budget, and strategy, all sharing that account's wallet.
- **Reliability-first.** Crash-only worker, idempotent jobs, and a version-aware per-symbol state commit mean a restart resumes cleanly and never double-places an order.

Persistence is Postgres + TimescaleDB; cache and queues are Redis + BullMQ. Schema lives in [`packages/db`](packages/db).

### Act on a symbol

Every monitored symbol gets a workspace: live market data, the strategy's current signal, open orders, and manual overrides in one place.

<img src="docs/assets/readme/symbol-workspace.png" alt="Symbol workspace showing a live candle chart with the entry price and trailing stop drawn on it" width="900" />

### Tune a strategy, then backtest it

Configure a strategy per profile, then replay it against historical candles before risking anything. Every run is kept, so you can compare windows and symbols side by side.

<img src="docs/assets/readme/backtest-history.png" alt="Backtest history listing past runs with their window period, status and profit or loss" width="900" />

More screens are covered in the [user guide](https://chrisleekr.github.io/binance-trading-bot/user-guide/).

### Ask an AI agent

Optionally, connect an AI agent such as Claude Code over [MCP](https://modelcontextprotocol.io). Once you approve it, it can read your accounts, profiles, orders and backtests, and place orders and change settings through the same checks as the web app. It is off by default. See [AI agents (MCP)](https://chrisleekr.github.io/binance-trading-bot/operations/ai-agents/).

## Configuration

Per-profile configuration (grid, indicators, notifier providers, Technicals gates) lives in the database and is editable through the SPA after first run. See [configure a profile](https://chrisleekr.github.io/binance-trading-bot/get-started/configure/).

Process-level environment variables (`DATABASE_URL`, `REDIS_URL`, `WEB_ORIGIN`, `AUTH_SECRET`, etc.) are listed in [`.env.example`](.env.example) and described in the [environment variable reference](https://chrisleekr.github.io/binance-trading-bot/operations/env-vars/).

## Quick start (development)

Prerequisites: [Bun](https://bun.sh) 1.4+ (exact version pinned in `.tool-versions`; `bun.lock` is a `lockfileVersion: 2` file that Bun 1.3.x cannot parse) and Docker (with the `compose` plugin) for the local Postgres + Redis stack.

Run all commands from the repo root.

```bash
# 1. Install deps, write .env from .env.example, bring up Postgres + Redis
#    with host ports exposed (via the local compose override), and run
#    migrations.
bun install
bun run setup

# 2. Start api + web + worker + technicals via turbo
bun run dev
```

Open the SPA at `http://localhost:5173`.

To run the whole stack in containers instead, use `bun run docker:dev`. One `app` service (ROLE=all) serves the SPA + `/api` on `http://localhost:53000`.

## Quick start (deploy to a VM)

The 9-step operator runbook lives at [`deploy/README.md`](deploy/README.md). It covers `.env`, `AUTH_SECRET`, image pull, `docker compose up`, migrations, onboarding, IP-allowlisting the Binance key, smoke tests, and three TLS options.

Images are published to Docker Hub as `chrisleekr/binance-trading-bot:vX.Y.Z`. Pin a version with `IMAGE_TAG` rather than tracking `:latest`.

## Documentation

The full guide is at **<https://chrisleekr.github.io/binance-trading-bot>**, split by audience:

| Audience | What's there |
| --- | --- |
| [**Get started**](https://chrisleekr.github.io/binance-trading-bot/get-started/) | Install, configure a profile, go live |
| [**User guide**](https://chrisleekr.github.io/binance-trading-bot/user-guide/) | Dashboard, symbol workspace, profile and account settings |
| [**Concepts**](https://chrisleekr.github.io/binance-trading-bot/concepts/) | Strategies, discovery, technicals, backtesting, notifiers, written for non-experts |
| [**Operations**](https://chrisleekr.github.io/binance-trading-bot/operations/) | Deploy, kill switch, AI agents (MCP), environment variables, troubleshooting |
| [**Contributing**](https://chrisleekr.github.io/binance-trading-bot/contributing/) | Architecture, plugin contracts, CI gates, coding rules, testing |

Build the site locally:

```bash
bun run docs:install
bun run docs:serve   # http://127.0.0.1:8000
```

## Contributing

Issues and pull requests are welcome at [github.com/chrisleekr/binance-trading-bot](https://github.com/chrisleekr/binance-trading-bot).

1. Read [`CONTRIBUTING.md`](CONTRIBUTING.md) for the workflow.
2. Read [`AGENTS.md`](AGENTS.md) for the engineering charter and the invariants (`CLAUDE.md` is a symlink alias for Claude Code).
3. `bun run lint` and `bun run typecheck` must be clean before opening a pull request.

Security issues: please follow [`SECURITY.md`](SECURITY.md) rather than opening a public issue.

## License

[Apache-2.0](LICENSE). Third-party attributions are in [`NOTICE`](NOTICE).

## Disclaimer

I give no warranty and accept no responsibility or liability for the accuracy or the completeness of the information and materials contained in this project. Under no circumstances will I be held responsible or liable in any way for any claims, damages, losses, expenses, costs or liabilities whatsoever (including, without limitation, any direct or indirect damages for loss of profits, business interruption or loss of information) resulting from or arising directly or indirectly from your use of or inability to use this code or any code linked to it, or from your reliance on the information and material on this code, even if I have been advised of the possibility of such damages in advance.

**So use it at your own risk!**
↑