Let AI Trade for You: HKU’s Open‑Source Vibe‑Trading Agent Handles Research, Backtesting, and Order Execution in One Command
Vibe‑Trading, an open‑source AI‑driven personal trading agent from HKU’s Data Intelligence Lab, lets users issue a natural‑language prompt to automatically fetch data, generate strategy code, run vectorized backtests across multiple markets, produce detailed reports, and simulate live orders, while offering self‑improving behavior, multi‑agent teams, a 460‑plus academic factor library, and extensive broker connectors.
Agent‑Centric Trading Workbench
Vibe‑Trading supplies an AI agent that receives a natural‑language prompt, selects appropriate tools, fetches market data, generates strategy code, runs a vectorised backtest, creates charts and a report, and can simulate orders—all without the user writing Python code.
Contrast with Traditional Quant Frameworks
Frameworks such as Zipline, Backtrader or vectorbt require the user to author Python scripts and manually orchestrate data retrieval, backtesting and reporting. Vibe‑Trading’s agent performs the entire pipeline automatically based on the prompt.
Core Capabilities
1. Self‑Improving Trading Agent
The agent can ingest a personal trade‑log CSV exported from Futu, Tonghuashun or Eastmoney. After parsing, it computes:
Win rate, average holding duration and trade rhythm
Behavioural biases such as disposition effect and chase‑loss patterns
A personal trading‑behaviour profile
2. Multi‑Agent Trading Teams (Swarm Mode)
Four built‑in committee configurations coordinate several specialised agents:
Investment Committee : long‑side analyst, short‑side analyst, risk officer, portfolio manager
Quant Strategy Desk : factor research, strategy generation, backtest validation
Risk Committee : portfolio stress testing, VaR, attribution analysis
Crypto Research Group : on‑chain and coin‑market research
Running a swarm produces separate reports from each agent, which a portfolio manager can aggregate.
3. Cross‑Market Data Access & Vectorised Backtest Engine
18 data sources cover:
A‑shares: Tushare, AKShare, mootdx, Eastmoney, Sina, Futu
Hong‑Kong & US equities: Yahoo, Finnhub, Alpha Vantage, SEC EDGAR
Cryptocurrency: OKX, Binance, CCXT (100+ exchanges)
FX/Futures: MT5 (Exness)
Indian markets: NSE, BSE
The backtest engine is vectorised using bottleneck + NumPy. Reported metrics include information coefficient (IC), information ratio (IR), maximum drawdown, Sharpe ratio, turnover and factor attribution (market, industry, style).
4. Shadow Account – Rule Extraction & Cross‑Market Validation
When a profitable historical trade log is supplied, the agent automatically derives 3‑5 if‑then rules (e.g., RSI < 30 && 5‑day drawdown > 8% → BUY) and creates a “shadow account”. The workflow then:
Runs multi‑market backtests of the extracted rules across A‑shares, Hong‑Kong, US stocks and crypto.
Scans today’s market data to list symbols that trigger the rules.
This mirrors the style‑fitting and cross‑market validation steps typically performed by factor‑research teams.
Academic Factor Library (Alpha Zoo)
More than 460 pre‑implemented academic factors are available, including:
Classic sets: alpha101, qlib158
Frazzini‑Pedersen anti‑beta
Amihud liquidity
Harvey‑Siddique skewness
Chinese‑market factors: Jegadeesh reversal, George‑Hwang 52‑week highs
The alpha compare CLI command displays head‑to‑head IC, IR and win‑rate for any two factors without writing custom backtest code.
Order Execution Module
12 broker connectors are bundled (IBKR, Robinhood, Tiger, Alpaca, Longbridge, Binance, OKX, Futu, Dhan, Shoonya, Trading 212, MT5). All connectors default to paper‑trading mode. Switching to live trading requires an explicit mandate specifying symbol pool, position size, leverage and daily limits. Safety mechanisms include a file‑level kill switch and comprehensive audit logs.
Security warning: The X account VibeTrading_HKU, Virtuals project 101845, and token contract 0x640B… are impersonations. The project has never issued any token or memecoin. Do not purchase, connect wallets, or sign anything.
Installation & Quick Start
pip install vibe-trading-aiInitialize configuration (writes ~/.vibe-trading/.env): vibe-trading setup Launch the web UI (default port 5173): vibe-trading dev Docker images are provided with built‑in host.docker.internal support for local Ollama instances.
Prerequisites for Full Functionality
Configure an LLM provider (e.g., DeepSeek, Claude, Kimi, GLM) and obtain the corresponding API key.
Obtain at least one data‑source API key (e.g., Tushare token, Finnhub key).
Understand the concepts of swarm execution, research goals and shadow accounts.
Operational Considerations
Rapid development cadence: repository version progressed from 0.1.9 to 0.1.12 with daily PR merges.
All 460 factor docstrings are available in Chinese, contributed by the community.
Live trading is opt‑in and protected by kill‑switch, mandate and audit logging; users must assess AI‑driven trading risk themselves.
Data caching is disabled by default; enable with environment variable VIBE_TRADING_DATA_CACHE=1.
One‑Sentence Summary
Vibe‑Trading is an AI‑driven trading agent that can call over 70 tools to fetch data, generate code, run vectorised backtests, produce reports and simulate orders from a single natural‑language command, and can also reverse‑engineer personal trading rules for cross‑market validation.
GitHub repository: github.com/HKUDS/Vibe-Trading
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Geek Labs
Daily shares of interesting GitHub open-source projects. AI tools, automation gems, technical tutorials, open-source inspiration.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
