← Open Source

a high-performance, easy-to-use, multi-symbol, multi-strategy, multi-period, multi-account event-driven trading bot.

ApplicationsSpecialistsGo
Momentum
+0stars in 24 hours0.0%
690
Stars
138
Forks
+1
This week
9
Contributors
Created 2023-12-07 · Updated 2026-12-02 · #19052 today
Top developers
anyongjinwynnfortheworkaxlnur
README

banbot

banbot is a high-performance, easy-to-use, multi-symbol, multi-strategy, multi-period, multi-account event-driven trading robot.

Main Features

  • 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_interest and mark/index/premium klines, see Custom data.
  • order types: limit/stop entries, exchange-side stop-loss and take-profit, trailing stop, see Custom strategy.

Supported Exchanges

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

Quick start

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/mcp

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

Typical workflow

  1. Set up – open the Web UI; the home page checks data directory, database, candles, compiled strategies and backtests, and guides you through settings.
  2. Strategy – edit Go strategies in the UI, ask an AI client over MCP, or use JS scripts; compile from the Web UI.
  3. Data – download candles and other time series (funding rate, open interest, custom series); inspect coverage and gaps.
  4. Backtest and optimize – submit tasks, follow them in the task center, review signals/fills/equity, compare runs, tune parameters.
  5. 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.
  6. 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.

Work with AI

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.

Document

Please go to BanBot Website and the documentation site for documents; maintainers' module docs are in doc/project.

Contributing

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.

Donate

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

LICENSE

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.

Strategy engines

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.

Nearby in the ranking
Similar items

AI Rank for iPhone

Follow AI model rankings

Download on the App Store