Open Source
Open Source

Vibe-Trading: One Command to Give AI Agents Trading Capability, by HKU HKUDS

GitHub hot personal trading agent framework. Shadow Account simulated trading + multi-broker (yfinance/CCXT/akshare/MT5 etc.) + backtest + alpha bench + memory lifecycle + MCP server. Complements TradingAgents (decision vs execution/backtest).

Published July 25, 20269 min readUpdated July 28, 2026
<!-- vibe-trading-resource | resource | Vibe-Trading Personal Trading Agent -->

Vibe-Trading is an open-source quant research workspace from HKUDS (HKU Data Science Lab) that turns natural-language questions into runnable analysis: one prompt reaches market-data loaders, strategy generation, backtest engines, report exports, and persistent research memory. As of late July 2026 it sits at 28,111 stars, 4,560 forks, MIT license, pure Python, first commit on April 1, 2026, latest release v0.1.12 shipped July 22 - three months of iteration to 0.1.12, Trendshift-listed. It does more than one thing: 22 free market-data sources with IP-ban-risk auto-fallback, 8 backtest engines covering A-shares/HK-US/crypto/futures/forex/options, 462 pre-built alpha factors, 12 broker connectors, 30 multi-agent preset teams, 54 MCP tools, 88 finance skills. One-line positioning: let an LLM agent actually backtest, actually connect to brokers, actually run research - not just "chat" about trading.

What Pain It Solves

Anyone doing quant research has been tortured by this fragmented pipeline: pulling market data means wiring up tushare/yfinance/ccxt APIs separately, and A-share sources can IP-ban you; backtest engines you write yourself, and A-share T+1, price limits, ST filtering, India's T+1 and circuit bands, crypto funding settlements - every market has its own rules; validating a factor means standing up another IC/IR stack; once a strategy is done, exporting to TradingView/TDX/MT5 is yet another mess; and when you try to bring an AI agent in, the LLM just "answers from memory" instead of calling tools. Vibe-Trading packs all of this into one workspace: one natural-language prompt ("Backtest a BTC-USDT 20/50 moving-average strategy for 2024, summarize return and drawdown") and the agent picks the data source, generates strategy code, runs the matching engine, and produces a validation report. The core shift is from "assembling ten tools" to "one agent stringing together the data-backtest-validate-export chain," with 22 data sources auto-ordered into fallback chains by IP-ban risk so you don't worry about which source is down today.

22 Data Sources with Smart Fallback + 8 Backtest Engines + 462 Alpha Zoo

The data layer is its thickest part. One get_market_data call sits behind 22 free sources plus the optional QVeris premium marketplace; with source: "auto" it auto-selects by symbol, then walks a fallback chain ordered by "IP-ban risk" - never-banned sources first, throttled and key-gated ones last. A-shares go through tencent/mootdx (Tongdaxin TCP-direct, never IP-banned)/eastmoney/baostock/akshare/tushare, US through yahoo/stooq/sina/yfinance, crypto through okx/ccxt/binance, HK/US also reach longbridge/futu, forex/metals through MT5, India NSE/BSE has a dedicated engine, and even local CSV/Parquet/DuckDB files feed in via the local: prefix. Zero config, no single point of failure, all free except the tushare token. The backtest layer has 8 engines split by market rules: ChinaA (T+1, price limits, ST pre-filter), GlobalEquity (T+0), IndiaEquity (T+1, circuit bands, STT/stamp/SEBI/GST cost stack), Crypto (spot + USD-M perps, funding settlements, execution/mark-price split), ChinaFutures/GlobalFutures (margin, contract multipliers), Forex, Composite (cross-market shared capital pool), options_portfolio (multi-leg, Greeks, payoff/scenario). 15 metrics plus benchmark comparison, 5 portfolio optimizers (equal-vol/risk-parity/mean-variance/max-div/turnover-aware), 3 validation suites (Monte Carlo/Bootstrap/walk-forward), with PIT-safe data and run_card.json for reproducible research. On top of that hang 462 pre-built alphas - qlib158 (Microsoft Qlib, 154), alpha101 (Kakushadze 101), gtja191 (Guotai Junan 191), academic (Fama-French 5 + Carhart + Jegadeesh etc., 12), fundamental (PIT-safe SEC, 4); one line vibe-trading alpha bench --zoo gtja191 --universe csi300 --period 2018-2025 scores the whole zoo by IC and categorizes alive/reversed/dead, with an AST purity gate and a look-ahead-bias sentinel test guarding the factor layer.

Shadow Account + Multi-Agent Swarm + 12 Brokers

Shadow Account is its most distinctive piece - it doesn't start from a template strategy but reverse-engineers from your own trading records. Upload a broker export (Tonghuashun/Eastmoney/Futu/generic CSV), the agent first profiles your behavior (holding days, win rate, PnL ratio, drawdown, disposition effect, overtrading, momentum chasing, anchoring), then distills recurring entry/exit rules into an explicit strategy, backtests this "shadow strategy" against your actual trades, flagging rule breaks, early exits, missed signals, and counterfactual trades, and finally delivers an 8-section HTML/PDF report. The multi-agent Swarm ships 30 preset teams: investment_committee runs bull/bear debate - risk review - PM final call, quant_strategy_desk runs screening - factor research - backtest - risk audit, crypto_trading_desk runs funding/basis + liquidation + flow - risk manager, plus technical analysis panels, risk committee, global allocation committee, with workers grounded on fetched real market data rather than inventing numbers. The 12 broker connectors are tiered by "read + paper + bounded-live": IBKR local TWS read-only, Robinhood via OAuth bounded-live, Tiger/Alpaca/OKX/Binance/Futu read + paper + bounded-live, MT5 for forex, Longbridge/Dhan/Shoonya read + paper only (an API with no paper/live discriminator hard-refuses orders), Trading 212 fully read-only. Paper-vs-live is a structural per-broker runtime guard (account-id format, host separation, demo flag) - not a config flag the agent can flip; live order placement is bounded by a user-committed mandate (symbol allowlist, per-order/exposure caps, daily trade cap, filesystem kill switch, audit ledger), it never holds funds and runs no venue - the broker executes. On top sit 88 finance skills (data/strategy/analysis/asset/crypto/flow/tool/research/risk - 9 categories) and 54 MCP tools, usable as a stdio subprocess inside Claude Desktop/Cursor, and it can flip direction to call external MCP servers itself.

Three-Minute Setup

bash
# 1. Install (Python >= 3.11)
pip install vibe-trading-ai

# 2. Initialize .env, set your LLM provider key
vibe-trading init

# 3. Minimal runnable: one-prompt backtest
vibe-trading run -p "Backtest a BTC-USDT 20/50 moving-average strategy for 2024, summarize return and drawdown"

# 4. Verify: bench the whole alpha zoo
vibe-trading alpha bench --zoo gtja191 --universe csi300 --period 2018-2025 --top 20

No data-source keys needed - A-shares via mootdx/akshare, HK/US via yfinance, crypto via okx, all free with auto-fallback. The LLM defaults to DeepSeek deepseek-v4-pro; you can swap in Ollama for local offline, or OpenAI/Anthropic/Gemini/Kimi/Qwen among 18+ providers. To plug into Claude Desktop/Cursor via MCP, run vibe-trading-mcp to start a stdio subprocess and 54 tools auto-register; to launch the Web UI, vibe-trading serve --port 8899.

Who It's For + Five Pitfalls

For: quant researchers wanting one-stop data-backtest-factor validation; AI-trading experimenters running backtests in natural language or via an MCP agent; retail traders reverse-engineering strategy from their own trade records; anyone needing multi-market, multi-broker paper trading.

Five pitfalls. One, the wrong model breaks the agent - it's a tool-heavy agent, and small models like nano/flash-lite/coder-next have unreliable tool-calling, so the agent "answers from memory" instead of loading skills or running backtests; the team recommends deepseek-v4-pro as the daily driver, claude-opus-4.7/gpt-5.5-pro for complex multi-agent swarms. Two, live trading is experimental - the broker capability is officially "use at your own risk, not verified against a real account," it only runs inside your mandate, is haltable, and holds no funds; don't treat it as a production HFT system. Three, data-source IP bans - eastmoney gets throttled, tushare needs a token; for A-shares prefer mootdx (TCP-direct, never banned), don't lean on a single source; the fallback chain is already ordered by ban risk, let it walk. Four, Windows quirks - the pandas 3.0 Timestamp crash (the team pins <3.0.0), the os.fchmod settings-save 500 on Windows (now platform-guarded), and Docker reaching Ollama via host.docker.internal instead of localhost. Five, the impersonation scam - there's a fake X account VibeTrading_HKU and a token contract 0x640BDBF77...; the project has never launched or endorsed any token or memecoin, don't connect a wallet or sign anything, the only official Discord is discord.gg/6TdQnT5xcF.

Risk note: Vibe-Trading is research and trading software. This article is not investment advice. Past performance does not guarantee future results; live trading happens through a broker you authorize yourself, at your own risk.

vs. the Competition

Against Microsoft Qlib, Qlib is a factor framework + backtest engine (origin of Alpha158), strong in factor engineering and an AI training pipeline, but with no broker access, no live trading, no LLM agent or MCP; Vibe-Trading absorbs Qlib's 158 alphas straight into its zoo and adds 22 data-source fallback, 12 brokers, 30 multi-agent swarms, and a natural-language entry point - positioned as a "research workspace" rather than a "factor library." Against backtrader, backtrader is an event-driven backtest library - flexible, but you wire data, write strategies, and handle A-share T+1/price-limit rules yourself; Vibe-Trading's 8 engines bake market rules in, auto-fallback data sources, and ship the alpha zoo and Shadow Account that backtrader lacks. Against TradingAgents, TradingAgents is a multi-agent decision-debate framework (analysts/researchers/trader/risk/portfolio manager debate), leaning toward "decisions"; Vibe-Trading leans toward "execution + backtest" (broker access + Shadow Account + alpha bench + data fallback). The two chain: TradingAgents produces a decision, Vibe-Trading backtests and executes it.


References

This article is AI-assisted and human-edited. Last updated: 2026-07-28

Related