PromptHub
Back to Blog
Developer Tools Quantitative Finance

HKUDS/Vibe-Trading: Open-Source Agent for Automated Quant Strategies

B

Bright Coding

Author

10 min read 29 views
HKUDS/Vibe-Trading: Open-Source Agent for Automated Quant Strategies

Introduction

Building quantitative trading strategies traditionally demands expertise across multiple domains: market microstructure, data engineering, backtesting frameworks, and broker APIs. The gap between a research idea and production-ready code often spans weeks of boilerplate—data loaders, signal engines, execution adapters, and risk controls. For developers and quantitative researchers, this friction slows iteration and discourages experimentation.

HKUDS/Vibe-Trading addresses this directly. Positioned as "Your Personal Trading Agent," it provides a command-line and web-accessible runtime where natural language prompts drive the full strategy lifecycle: hypothesis generation, signal construction, backtesting, and live execution through broker connectors. With 24,213 GitHub stars, 4,028 forks, and an MIT License, it has gained substantial traction in the open-source quant community since its launch by the HKUDS (Hong Kong University Data Science) group.

This article examines what HKUDS/Vibe-Trading actually delivers, how to set it up, and where it fits in a modern quantitative developer's toolkit.

What is HKUDS/Vibe-Trading?

HKUDS/Vibe-Trading is a Python↗ Bright Coding Blog 3.11+ application built on FastAPI (backend) and React↗ Bright Coding Blog 19 (frontend), distributed via PyPI as vibe-trading-ai. It functions as an LLM-orchestrated trading agent—a system that interprets user instructions, delegates to specialized tools, and executes quantitative workflows with persistent state and audit trails.

The project sits at the intersection of three active technical trends: AI agent frameworks (LangChain/LangGraph-based tool orchestration), quantitative finance infrastructure (factor libraries, backtest engines, broker connectors), and local-first deployment (Docker↗ Bright Coding Blog, self-hosted API, MCP server compatibility). Its last commit was 2026-07-16, indicating active maintenance with a rapid release cadence—version 0.1.11 shipped on 2026-07-11, roughly three weeks after 0.1.10.

The HKUDS affiliation signals academic rigor in its factor research components. The project explicitly attributes its Alpha Zoo collections to published academic work—Microsoft Qlib, Kakushadze's 101 Formulaic Alphas, Guotai Junan's 191-factor report, and Fama-French-Carhart models—rather than treating them as proprietary black boxes. This transparency matters for developers evaluating whether to build research on top of the platform.

Key Features

Natural Language Strategy Generation

The core value proposition is Research Autopilot: a multi-phase pipeline where the agent scaffolds signal engines from hypotheses, generates backtest configurations, and feeds metrics back for iteration. As of Phase 3 (2026-06-20), this spans 68 tools including scaffold_signal_engine, link_autopilot_backtest, and hypothesis registry operations.

Comprehensive Market Data Layer

The project integrates 18 free data sources including Eastmoney, Sina, Stooq, Yahoo Finance, Tushare, OKX, and CCXT-exchanges, plus key-gated premium sources (Finnhub, Alpha Vantage, Tiingo, FMP). A local data cache (VIBE_TRADING_DATA_CACHE) avoids repeated network calls. Recent additions include Longbridge for HK equities, Indian equity support (NSE/BSE via dedicated IndiaEquityEngine), and Binance USD-M perpetuals.

Alpha Zoo: Pre-Built Factor Library

461 pre-built alphas across four collections: qlib158, alpha101, gtja191, and academic (Frazzini-Pedersen betting-against-beta added 2026-07-13). Each includes AST purity gates, lookahead-bias tests, and pytest-socket network kill-switches for reproducible research.

Multi-Broker Connector Architecture

Ten broker connectors support paper and read-only trading: IBKR (local TWS/Gateway), Robinhood (MCP/OAuth), Alpaca, Tiger, Longbridge, OKX, Binance, Futu, Dhan, and Shoonya. Live order placement requires explicit mandate commitment with exposure caps, kill switches, and audit ledgers—designed as "bounded autonomy" rather than unsupervised execution.

Multi-Modal Agent Runtime

The swarm system deploys specialized worker agents (investment committee, quant desk, risk committee) with live status streaming. 16 IM channel adapters (Telegram, Slack, Discord, WeChat, Feishu/Lark, etc.) enable research delivery. The MCP server exposes tools to external AI systems with Streamable HTTP transport.

Security & Observability

Recent hardening includes AST-sandboxed backtest execution (blocking network/subprocess/eval/os.environ), hash-locked dependencies, Docker multi-stage builds with digest-pinned images, and CSRF protection for local API access. Per-run token usage tracking and layered attribution analysis (beta regression, Monte Carlo permutation tests) support cost and performance auditing.

Use Cases

1. Rapid Strategy Prototyping

A quant researcher describes a momentum-reversal hypothesis in natural language. The agent generates a signal engine with PIT-safe (point-in-time) fundamental overlays, runs backtest validation with causal rebalancing, and surfaces IC/IR metrics—compressing days of boilerplate into minutes of iterative conversation.

2. Cross-Market Factor Research

With unified loaders for A-share (Tushare/mootdx/akshare), US equity (yfinance/SEC EDGAR), crypto (CCXT/OKX/Binance), and Indian markets, researchers can test factor portability across regimes. The alpha compare tool benches selected alphas head-to-head without scoring the full zoo.

3. Automated Research Monitoring

The strategy-dev-manager skill (added 2026-07-12) registers factors from academic papers or broker research, monitors IC/Sharpe decay, and disables degraded signals—maintaining a living research pipeline without manual bookkeeping.

4. Paper Trading Validation

Before live deployment, strategies run against broker paper accounts with identical execution logic. The shadow account system extracts entry rules with RSI/prior-return bounds, generating condition-aware signal engines rather than naive holding cadence replays.

5. IM-Delivered Research Alerts

Configure the agent to run scheduled research (cron/interval via VIBE_TRADING_ENABLE_SCHEDULER) and deliver summaries through Telegram, Slack, or WeChat—useful for PMs who want concise, timely updates without dashboard monitoring.

Installation & Setup

PyPI Install (Recommended)

pip install vibe-trading-ai

For optional features:

pip install "vibe-trading-ai[harmonic]"    # Harmonic pattern detection
pip install "vibe-trading-ai[deepseek]"    # Native DeepSeek adapter
pip install "vibe-trading-ai[telegram]"    # Telegram channel adapter
pip install "vibe-trading-ai[channels]"    # All 16 IM channels

Docker Deploy

git clone https://github.com/HKUDS/Vibe-Trading.git
cd Vibe-Trading
docker compose up --build

The compose file defaults OLLAMA_BASE_URL to http://host.docker.internal:11434 for host-side LLM access. Named volumes preserve data across rebuilds: memory, session index, user skills, shadow accounts, and broker config.

Interactive Setup

vibe-trading setup      # Configure environment, verify dependencies
vibe-trading dev        # Launch backend + frontend in dev mode

Provider Configuration

Set LLM provider via environment or ~/.vibe-trading/.env:

# OpenAI-compatible (default)
export OPENAI_API_KEY=sk-...

# DeepSeek
export DEEPSEEK_API_KEY=sk-...

# NVIDIA NIM (first-class provider as of 2026-07-14)
export NVIDIA_API_KEY=nvapi-...

# Local Ollama
export OLLAMA_BASE_URL=http://localhost:11434

The Web UI Settings panel writes to the canonical env path with legacy config migration.

Real Code Examples

Example 1: Bench Alpha Zoo Factors

The CLI provides one-line factor evaluation against custom universes:

# Bench GTJA 191 factors on CSI 300, 2018-2025
vibe-trading alpha bench \
  --zoo gtja191 \
  --universe csi300 \
  --period 2018-2025

This invokes run_bench() with the full zoo, or run_bench(only=...) for subset comparison. The output surfaces IC mean, IC standard deviation, information ratio, and IC-positive ratio per factor—enabling rapid screening before deeper research.

Example 2: Compare Specific Alphas

For head-to-head comparison without full-zoo overhead:

vibe-trading alpha compare <id1> <id2> <id3> --sort ir

This powers four surfaces simultaneously: CLI, Web UI Compare view, REST API (POST /alpha/compare with SSE streaming), and agent tool (alpha_compare). The --sort ir flag ranks by information ratio gap to leader.

Example 3: Resume Prior Session

The CLI now exposes session continuity:

# After exit, copy the printed session-id
vibe-trading resume <session-id>

This replays recent turns into the loop, preserving research context. Unknown IDs fail fast rather than silently creating blank sessions—preventing the "which folder is newest" discovery problem.

Example 4: Connector Management

Broker profiles are managed uniformly:

vibe-trading connector list          # Available connectors
vibe-trading connector use alpaca    # Select profile
vibe-trading connector account       # Read-only account info
vibe-trading connector positions     # Current positions

Live trading requires explicit mandate commitment; place_order hard-refuses without configured paper/live boundaries and safety gates.

Advanced Usage & Best Practices

Cache aggressively for backtest iteration. Enable VIBE_TRADING_DATA_CACHE=1 to store settled historical bars under ~/.vibe-trading/cache. This bypasses network latency and rate limits on repeated runs, with automatic staleness guards for incomplete current-day bars.

Use the provider doctor for debugging. When LLM calls hang or fail, vibe-trading provider doctor emits a redacted snapshot of provider, model, package versions, and proxy configuration—enabling one-command triage without exposing credentials.

Structure swarm runs with explicit presets. The run_swarm command accepts --preset_name to avoid ambiguous keyword routing. Presets like investment_committee, quant_desk, and risk_committee configure worker tool access and grounding policies; omitting this risks silent fallback to equity_research_team.

Guard against look-ahead bias. The backtest engine enforces causal rebalancing and order-independent execution, but researchers should still verify that custom signal engines respect the PIT-safe fundamental layer (fund:* columns with filed-date anchoring). The built-in validation catches common errors, but domain awareness remains essential.

Monitor token usage for cost control. Each run persists llm_usage.json with provider-reported token counts. For high-frequency research automation, set budget alerts at the provider level rather than relying on post-hoc analysis.

Comparison with Alternatives

Dimension HKUDS/Vibe-Trading QuantConnect Backtrader
Orchestration LLM-agent driven with tool use Cloud IDE + scheduled jobs Python framework, manual wiring
Data sources 18+ free, 63+ via QVeris premium Integrated vendor feeds User-provided or third-party
Broker connectors 10 with paper/live guards Multiple viaLEAN Limited, community extensions
Factor library 461 pre-built with attribution User/community None built-in
Deployment Local/Docker/self-hosted Cloud-managed Local Python
License MIT Proprietary (core open) GPL-3.0

QuantConnect offers deeper institutional data and cloud scale but requires LEAN-specific syntax and has less flexible AI integration. Backtrader remains lightweight for custom engine development but lacks the agent orchestration and pre-built factor infrastructure. HKUDS/Vibe-Trading occupies a middle ground: more opinionated than raw frameworks, more hackable than managed platforms—particularly suited to researchers who want natural language iteration without sacrificing execution control.

FAQ

What Python version is required? Python 3.11 or higher, enforced at install time.

Is live trading safe? Live order placement requires explicit mandate commitment with exposure caps, kill switches, and audit trails. Several connectors (Longbridge, Dhan, Shoonya) are read-only or paper-only by structural design.

Does it work on Windows? Yes, with platform-specific fixes as of 2026-07-05. The os.fchmod hardening is now guarded, and cache isolation handles Windows path semantics.

What LLM providers are supported? OpenAI, DeepSeek, Anthropic, Google Gemini, NVIDIA NIM, Zhipu/GLM, Kimi, Moonshot, OpenRouter, Requesty, and local Ollama—each with provider-specific capability handling.

How is the project licensed? MIT License, permitting commercial use with attribution.

Can I use my own data? Yes, the local loader reads CSV, Parquet, and DuckDB files directly.

Is there a token or cryptocurrency? No. The project explicitly warns that any claimed token or contract address is fraudulent and not affiliated with HKUDS/Vibe-Trading.

Conclusion

HKUDS/Vibe-Trading delivers a credible, actively maintained open-source platform for AI-assisted quantitative strategy development. Its strength lies in bridging natural language iteration with production-grade execution infrastructure—factor libraries, multi-broker connectors, and sandboxed backtesting—while maintaining transparency through academic attribution and MIT licensing.

It best serves quantitative developers and researchers who value rapid hypothesis-to-backtest cycles, need cross-market data coverage (particularly A-share, US, and crypto), and prefer self-hosted deployment with explicit safety boundaries over managed cloud platforms.

The project is evolving quickly; with 24,000+ stars and weekly feature releases, now is a reasonable time to evaluate it for research workflows. Start with the PyPI install and the alpha bench command to assess factor fit, then explore the swarm and connector layers as your use case demands.

Explore the repository: https://github.com/HKUDS/Vibe-Trading

For related reading on agent-based financial infrastructure, see our coverage of [INTERNAL_LINK: LLM-orchestrated data pipelines].

Comments (0)

Comments are moderated before appearing.

No comments yet. Be the first to share your thoughts!

Recommended Prompts

View All
All tools