Vibe-Trading Setup Guide: Open-Source AI Trading Agent (2026)

beginner 25 min · · By Alpha Guy · claude-code chatgpt

What Is Vibe-Trading?

Vibe-Trading is a free, open-source AI trading agent from the HKU Data Intelligence Lab. You describe a strategy in plain English, and it generates code, runs backtests, and produces portfolio analysis across stocks, crypto, and A-shares. It ships with 64 finance skills, 29 agent presets, and supports 12 LLM providers including free local models through Ollama.

If you have used tools like Claude Code to build trading bots, Vibe-Trading takes a different approach. Instead of writing prompts and editing code yourself, you interact with a multi-agent system that handles the entire pipeline: research, strategy design, backtesting, and export. Think of it as a trading-specific wrapper around LLMs, with pre-built financial tools plugged in.

Who This Is For

Vibe-Trading works for three types of users:

  • Non-coders who want to test strategy ideas without writing Python
  • Developers who want a pre-built financial agent framework to extend
  • Quant researchers who want to prototype strategies quickly before porting them to production systems

You do not need programming experience to get started. The Docker install takes about 5 minutes, and the chat interface works like any AI chatbot.

What You Need Before Starting

RequirementDetails
ComputerMac, Linux, or Windows with WSL2
RAM8 GB minimum, 16 GB recommended
DockerDocker Desktop installed and running
LLM API keyOpenAI, Anthropic, DeepSeek, or any of the 12 supported providers
Market data APINone required — free data from yfinance, OKX, and AKShare is built in

If you want to use a local LLM instead of a paid API, install Ollama first and pull a model like llama3 or qwen2. This lets you run Vibe-Trading with zero ongoing cost.

Docker is the fastest path. It bundles all dependencies and avoids Python version conflicts.

git clone https://github.com/HKUDS/Vibe-Trading.git
cd Vibe-Trading
cp agent/.env.example agent/.env

Edit the .env file and add your LLM API key:

# Pick one provider and uncomment it
# For OpenAI:
OPENAI_API_KEY=sk-your-key-here

# For Anthropic (Claude):
ANTHROPIC_API_KEY=sk-ant-your-key-here

# For DeepSeek (cheapest paid option):
DEEPSEEK_API_KEY=your-key-here

# For local Ollama (free):
OLLAMA_BASE_URL=http://host.docker.internal:11434

Then build and run:

docker compose up --build

Open http://localhost:8899 in your browser. You should see the Vibe-Trading chat interface.

Option 2: Local Python Install

If you prefer running without Docker or want to modify the source code:

git clone https://github.com/HKUDS/Vibe-Trading.git
cd Vibe-Trading
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -e .
cp agent/.env.example agent/.env

Edit .env with your API key (same as above), then launch:

vibe-trading

This opens the terminal UI (TUI). For the web interface, run the API server separately:

cd agent && python -m agent.server  # Starts on port 8899
cd frontend && npm install && npm run dev  # Starts on port 5899

Your First Strategy: A Moving Average Crossover

Once the interface is loaded, try this prompt:

Backtest a simple moving average crossover on BTC/USDT. Use 20-period and 50-period SMAs on daily candles. Go long when the 20 SMA crosses above the 50 SMA, exit when it crosses below. Test from January 2024 to March 2026. Show me the equity curve and key metrics.

Vibe-Trading will:

  1. Fetch historical BTC/USDT data (free, no API key needed for crypto via OKX)
  2. Write the strategy code
  3. Run the backtest
  4. Display results with charts and performance metrics

The whole process takes 30-60 seconds depending on your LLM speed. You should see Sharpe ratio, max drawdown, total return, and a trade log.

Built-in Market Data Sources

One of the main advantages over building bots from scratch: Vibe-Trading includes free data for multiple markets without any API keys.

MarketData SourceCoverage
US StocksyfinanceFull historical OHLCV, fundamentals
Hong Kong StocksyfinanceFull historical OHLCV
CryptoOKX public APIAll major pairs, full history
China A-SharesAKShareReal-time and historical
FuturesAKShareMajor contracts
ForexAKShareMajor pairs

If you need premium data (tick-level, order book depth), you can plug in your own data sources through the extension API.

Exporting Strategies

After backtesting, you can export your strategy to three platforms:

TradingView (Pine Script v6):

/pine

This converts your strategy into Pine Script that you can paste directly into TradingView. Useful if you want to run alerts or visual backtests on TradingView’s charting interface.

MetaTrader 5 (MQL5):

/mql5

Exports the strategy as an MQL5 Expert Advisor for MetaTrader 5. Handy for forex and CFD traders.

Chinese platforms (通达信/同花顺):

/tdx

Exports to TDX format for Chinese trading terminals. This is the only AI trading tool I have seen that supports A-share platforms natively.

The 29 Specialist Agent Teams

Vibe-Trading organizes its agents into specialist teams. When you ask a question, the system routes it to the right team. Here are the ones I found most useful:

Quant Team — Builds and backtests quantitative strategies. This is what handles the moving average example above.

Researcher Team — Pulls market data, news, earnings reports, and macro indicators. Ask it “What drove NVDA’s price action this week?” and it compiles a summary from multiple sources.

Risk Team — Analyzes portfolio risk metrics. Feed it your positions and it calculates VaR, correlation matrices, and concentration risk.

Macro Team — Tracks economic indicators, Fed decisions, and cross-market correlations. Good for context before making discretionary trades.

You can also build custom teams by combining skills. The documentation covers this, but for most users the default teams handle common workflows well.

Real Limitations

I want to be upfront about what Vibe-Trading does not do well:

It does not execute live trades. This is a research and backtesting tool. It generates strategies and tests them on historical data, but it does not connect to a broker to place real orders. If you want live execution, you need to export the strategy and run it through a separate system. For live crypto bots, see our Claude Code momentum bot tutorial or the DCA bot guide.

Backtest results are optimistic. Like all backtesting tools, results do not account for slippage, partial fills, exchange downtime, or the emotional reality of watching your bot lose money. The backtest says you would have made 40%? Expect roughly half that in live trading, and that is if the strategy holds up at all.

LLM quality matters a lot. The strategy code is only as good as the LLM generating it. With GPT-4o or Claude Sonnet 4.6, the output is solid. With cheaper models or small local LLMs, the generated code has more bugs and the strategies are less sophisticated. You get what you pay for.

The UI is rough. This is an academic open-source project, not a polished SaaS product. Expect occasional formatting issues in charts, slow response times with large datasets, and error messages that assume you know Python. It works, but it is not pretty.

Vibe-Trading vs Building Your Own Bot

If you are deciding between using Vibe-Trading and building a custom bot with Claude Code, here is how I think about it:

FactorVibe-TradingCustom bot (Claude Code)
Time to first backtest5 minutes2-4 hours
Live tradingNoYes
CustomizationLimited to frameworkUnlimited
Learning curveLowMedium-high
Best forRapid prototyping, idea validationProduction trading systems

Use Vibe-Trading to test ideas fast. If an idea looks promising, rebuild it as a custom bot with proper error handling, risk management, and exchange integration.

Troubleshooting Common Issues

Docker build fails with “permission denied”: Run sudo docker compose up --build or add your user to the docker group.

LLM API errors: Double-check your API key in .env. Make sure you uncommented the right provider. Only one provider should be active at a time.

No market data returned: yfinance occasionally rate-limits aggressive requests. Wait a minute and retry, or switch to a different ticker to confirm the setup works.

Frontend not loading: If using the local install, make sure both the API server (port 8899) and frontend dev server (port 5899) are running. The frontend proxies API calls to the backend.

Next Steps

Disclaimer: This article is for educational purposes only and is not financial advice. Trading cryptocurrencies involves substantial risk of loss. Past performance does not guarantee future results. Always do your own research before making any trading decisions. Read full disclaimer →
Alpha Guy
Alpha Guy

Founder of VibeTradingLab. Ex-Goldman Sachs engineer, 2025 Binance Top 1% Trader. Writes about using AI tools to build trading systems that actually work. Currently nomading between Bali, Dubai, and the Mediterranean.

Got stuck? Have questions?

Join our Telegram group to ask questions, share your bots, and connect with other AI traders.

Join Telegram