AI Study Online
AI News

Vibe-Trading: A Deep Dive into HKU's Open-Source Financial Agent OS

5 min read

In the realm of financial technology, Hong Kong University's open-source project Vibe-Trading has emerged as a game-changer. This financial Agent Operating System (OS) has garnered over 7,000 stars on GitHub within just a month of its release, showcasing its rapid adoption and potential. Let's break down its architecture, functionalities, and practical applications for global financial professionals.

What is Vibe-Trading?

Vibe-Trading is not a traditional financial tool—it's a financial Agent OS. Unlike standard software, it operates as an intelligent system where you simply give a command (e.g., "Analyze Moutai's stock performance"), and the Agent autonomously determines which tools to use, what code to write, which data to fetch, and how to run backtests. It's designed to handle cross-market analyses, supporting regions like A-shares, US stocks, and Hong Kong stocks seamlessly.

Core Architecture & Components

1. Multi-Layered Tool Ecosystem

Vibe-Trading boasts 30+ tools that act as the system's "hands and feet." These cover backtesting engines for different markets, code execution environments (sandboxes), knowledge loading modules, shadow account analysis, and multi-agent collaboration frameworks.

# Example prompt to analyze a stock with dual moving averages
prompt = "Analyze Moutai's stock performance over the past 3 years using a dual moving average strategy. Provide backtest results."

2. 72-Skill Knowledge Base

The system includes 72 specialized skills—a professional knowledge repository covering data API integrations, technical analysis frameworks, strategy templates, and workflow guides. When the Agent detects relevant keywords in your prompt, it automatically taps into these skills.

3. 452 Alpha Factors

For quantitative analysts, Vibe-Trading offers 452 stock selection factors across four academic systems: 101 from classic financial theories, 191 tailored for A-shares, 154 for HK stocks, and 6 from cutting-edge research.

# Fetch and analyze factors for a stock
factors = vibe_trading.get_factors(stock="Moutai", market="A-shares",
                                   categories=["valuation", "momentum"])
analysis = vibe_trading.analyze_factors(factors)
print(analysis.summary)

4. 33-Agent Team Collaboration

Vibe-Trading operates with a team of 33 specialized Agents, mimicking a real-world investment research department. When you request an analysis, the system deploys relevant agents: macro industry chiefs, technical analysts, quantitative researchers, and risk management experts—all working in tandem.

How It Works: The Think-Act-Observe Loop

Vibe-Trading follows a React-style loop to deliver results:

  1. Think: The Agent parses your request and decides on the next steps.
  2. Act: It executes the plan—writing code, fetching data, running backtests.
  3. Observe: It evaluates the results. If unsatisfied, it loops back to "Think" (up to 50 iterations).
def analyze_stock(stock, strategy):
    agent = VibeTradingAgent()
    plan = agent.think(stock, strategy)
    result = agent.act(plan)
    while not agent.observe(result) and agent.iterations < 50:
        plan = agent.think(stock, strategy, result)
        result = agent.act(plan)
    return result

moutai_result = analyze_stock("Moutai", "dual_moving_average")
print(moutai_result.backtest_metrics)

Practical Use Cases

1. Strategy Development & Backtesting

prompt = "Create a Python strategy for Moutai using RSI and MACD indicators.
          Backtest it over the past 3 years and return annual return,
          max drawdown, and Sharpe ratio."
strategy_result = vibe_trading.execute(prompt)
print(strategy_result.metrics)

2. Shadow Account Analysis

trade_data = load_trade_history("my_trades.csv")
shadow_analysis = vibe_trading.analyze_shadow_account(trade_data)
print(shadow_analysis.profit_patterns)
print(shadow_analysis.improvement_recommendations)

3. Cross-Market Research

prompt = "Compare Tencent's performance in HK and US markets over
          the past year. Use fundamental and technical factors."
cross_market_report = vibe_trading.generate_report(prompt)
print(cross_market_report.summary)

Why Vibe-Trading Stands Out

  • No Configuration Hassle: Tools and factors are pre-integrated—simply ask, and the Agent handles the rest.
  • Continuous Iteration: The project is actively updated with new features and markets added regularly.
  • Comprehensive Knowledge: The 72-skill library and 452 factors cover both mainstream and niche financial analyses.

Getting Started

git clone https://github.com/HKUDS/Vibe-Trading.git
cd Vibe-Trading
pip install -r requirements.txt
from vibe_trading import VibeTradingAgent

agent = VibeTradingAgent()
response = agent.query("Analyze Moutai's stock using a value-investing approach.")
print(response)

Vibe-Trading is revolutionizing how financial professionals conduct research and analysis. Its agent-driven architecture, rich toolset, and collaborative framework make it a must-try for anyone in the global financial sector. For more on AI agent applications, see AI for freelancers and Agent framework explained.

常见问题

Q: Do I need programming experience to use Vibe-Trading?

Basic Python knowledge is helpful, but the Agent OS is designed to minimize coding. You can interact with it using natural language commands, and it will write code, analyze data, and generate reports autonomously. However, understanding financial concepts is more important than programming skills.

Q: Which markets does Vibe-Trading support?

Vibe-Trading supports A-shares (China), US stocks, and Hong Kong stocks out of the box. Its 452 alpha factors are specifically tailored across these markets. The 33-agent team includes specialists familiar with each market's regulations and characteristics.

Q: Is Vibe-Trading suitable for retail investors or only institutions?

Both. While Vibe-Trading's architecture is institutional-grade (33 agents, 452 factors, 30+ tools), its natural language interface makes it accessible to retail investors. Start with simple commands like analyzing a single stock, then explore advanced features like shadow account analysis and multi-agent research as you become more comfortable.

Share this article

Related Articles