banbot is a high-performance, easy-to-use, multi-symbol, multi-strategy, multi-period, multi-account event-driven trading robot.
- web ui: write strategy, download data, backtest, optimize and deploy paper/live bots without an IDE.
- AI-ready: the Web UI starts a local MCP endpoint by default, so Claude Code, Codex or Cursor can research, backtest and edit strategies; an embedded assistant and sandboxed JS scripts are built in. See AI and MCP.
- high-performance: backtest for 1 year klines in seconds.
- easy-to-use: write once, support both backtesting and real trading.
- flexible: free combination of symbols, strategies and time frames.
- event-driven: no lookahead, more freedom to implement your trade ideas.
- scalable: trade multiple exchange accounts simultaneously.
- hyper opt: support bayes/tpe/random/cmaes/ipop-cmaes/bipop-cmaes
- time-series strategies: per-symbol Go callbacks over main/auxiliary timeframes, see Custom strategy.
- factor / cross-sectional engine: multi-factor ranking, portfolios and research, see Multi-factor strategies.
- statistical arbitrage and carry: pairs/spread strategies, including same-exchange spot-perpetual carry, see Statistical arbitrage.
- arbitrary time-series data: K-line extension columns and third-party series; built-in sources include
funding_rate,open_interestand mark/index/premium klines, see Custom data. - order types: limit/stop entries, exchange-side stop-loss and take-profit, trailing stop, see Custom strategy.
banbot supports exchanges powered by banexg. The markets below are what the adapters provide for market data and backtesting; default live execution (shared Hub, prod/dry_run) currently accepts linear perpetual accounts only, see the Shared accounts and Hub guide.
| logo | id | name | ver | websocket |
|---|---|---|---|---|
![]() |
binance | spot/usd-m/coin-m | * | Y |
![]() |
okx | spot/usd-m/coin-m | * | Y |
| bybit | bybit | spot/usd-m/coin-m | * | Y |
Fastest: use Docker via runbanbot. To build from source (Go 1.26+):
git clone https://github.com/banbox/banstrats && cd banstrats # example strategy project
go mod tidy && go build -o bot
./bot init --datadir ~/bandata # writes config.yml / config.local.yml
./bot web --datadir ~/bandata # Web UI http://127.0.0.1:8000 + MCP http://127.0.0.1:8001/api/mcpA generic prebuilt bot (enough for bot mcp connect/doctor) is attached to every release; install it with scripts/install/install.sh or install.ps1. Strategy work needs the binary compiled from your own strategy project.
bot web serves the Web UI plus a local MCP endpoint. Both are loopback-only by default; binding --host 0.0.0.0 requires --password. Disable MCP with --mcp=false, or restrict it to read/run with --mcp-write=false.
- Set up – open the Web UI; the home page checks data directory, database, candles, compiled strategies and backtests, and guides you through settings.
- Strategy – edit Go strategies in the UI, ask an AI client over MCP, or use JS scripts; compile from the Web UI.
- Data – download candles and other time series (funding rate, open interest, custom series); inspect coverage and gaps.
- Backtest and optimize – submit tasks, follow them in the task center, review signals/fills/equity, compare runs, tune parameters.
- Paper and live – preview and deploy a paper bot from a finished backtest, then run live through the shared-account Hub with the dashboard, approvals and notifications.
- Operate with AI – click "Connect AI" in the Web UI or dashboard and paste one sentence into your AI client; permissions are read / operate / trade, and real-account writes need approval.
Details: Typical workflow · Quick start · MCP guide.
Attach the knowledge base that matches your strategy engine (Chinese / English) to any AI conversation to tell it the strategy you want to test:
| Engine | 中文 | English |
|---|---|---|
| Time series | kb_ts_cn.md | kb_ts_en.md |
| Cross-sectional factor | kb_factor_cn.md | kb_factor_en.md |
| Statistical arbitrage | kb_statarb_cn.md | kb_statarb_en.md |
They are also embedded in the Go package github.com/banbox/banbot/kb and can be loaded from code:
// lang: "cn" | "en"; names: "ts" | "factor" | "statarb" (at least one, joined by kb.Separator)
text, err := kb.GetKB("en", "ts", "factor")More docs: doc/README.md.
Or immediately test your idea using the Banbot Workflow.
For live or research servers, bot mcp connect <code> pairs an AI client with one sentence; see Work with AI.
Please go to BanBot Website and the documentation site for documents; maintainers' module docs are in doc/project.
Follow How to Contribute. Get in touch via Discord to discuss development, new features, and the roadmap. Unless you explicitly state otherwise, any contributions intentionally submitted for inclusion in a banbot workspace you create shall be licensed under AGPLv3, without any additional terms or conditions.
If banbot made your life easier and you want to help us improve it further, or if you want to speed up development of new features, please support us with a tip. We appreciate all contributions!
| METHOD | ADDRESS |
|---|---|
| BTC | bc1qah04suzc2amupds7uqgpukellktscuuyurgflt |
| ETH | 0xedBF0e5ABD81e5F01c088f6B6991a623dB14D43b |
This project is dual-licensed under GNU AGPLv3 License and a commercial license. For free use and modifications of the code, you can use the AGPLv3 license. If you require commercial license with different terms, please contact me.
Choose run_policy.engine: time_series (default) for per-symbol callbacks or factor for native multi-factor/cross-sectional rounds. Root banbot backtest / banbot trade run either or both from one YAML configuration. Mixed replay uses execution.mode: events and explicit account budgets. Factor research uses root research, version archives use data archive, and standalone expressions use root validate / explain --spec. See the English guide, 中文指南, API.
Factor live needs application-registered verified transport, instrument/revision/funding evidence and startup reconciliation. Missing capabilities fail explicitly; SDK support alone does not prove real factor venue readiness. Paper/dry-run is separate historical simulation.
Configuration retains v0.5 root keys without requiring a version marker, and ordinary loading leaves YAML unchanged. Explicit run_policy[].engine enables new engine options; factor fields belong directly to each policy and account execution overrides to root accounts.<name>. See the compatibility comparison and configuration guide.

