Vibe-Trading
CLI ToolHKUDS/Vibe-Trading
AI-powered personal trading agent with one-command setup and multi-broker support.
Overview
Vibe-Trading is an AI-driven personal trading agent that integrates LLMs, multi-agent orchestration, and broker connectors for automated trading. It supports backtesting, real-time market data, and safety controls. Provides CLI, REST API, MCP, and web interface. Enables users to deploy trading strategies with one command.
README Preview
\n English | 中文 | 日本語 | 한국어 | العربية\n\n\n\n \n\n\nVibe-Trading: Your Personal Trading Agent\n\n\n One Command to Empower Your Agent with Comprehensive Trading Capabilities\n\n\n\n \n\n\n\n \n \n \n \n \n \n \n \n \n\n\n\n Website · \n Docs · \n News · \n Features · \n Shadow Account · \n Demo · \n Quick Start · \n Examples · \n API / MCP · \n Roadmap · \n Contributing\n\n\n\n \n\n\n---\n\n## 📰 News\n\n- **2026-06-03** 🧹 **Community triage + trace correlation**: Tool-call trace entries now carry the originating `call_id`, so a `tool_result` can be matched back to its `tool_call` when replaying a run trace — arg previews stay truncated to keep trace files small ([#168](https://github.com/HKUDS/Vibe-Trading/pull/168), thanks @zwrong). Source comments no longer point at an internal-only docs path that external contributors couldn't find ([#166](https://github.com/HKUDS/Vibe-Trading/issues/166), thanks @jaleelpersonal). Also clarified that the `langchain-community` resolver warning on install is a harmless leftover-package notice, not a failure ([#167](https://github.com/HKUDS/Vibe-Trading/issues/167)), and scoped Gemini 2.5/3.0 `thoughtSignature` round-tripping for function calls as a `help wanted` task with a full fix plan ([#170](https://github.com/HKUDS/Vibe-Trading/issues/170), thanks @jliu6789).\n- **2026-06-02** 🔌 **Six new broker connectors (Tiger / Longbridge / Alpaca / OKX / Binance / Futu)**: The connector-first trading layer gains a direct-SDK transport alongside IBKR (local) and Robinhood (MCP). Each connector exposes read-only account / positions / orders / quote / history **plus paper-account order placement** — test your strategies across these broker paper accounts. Five of them (Tiger, Alpaca, OKX, Binance, Futu) also support **bounded, mandate-ga
FAQ (5)
TroubleshootingWhy does vibe-trading return a 401 error when using DeepSeek v4 pro API key?
The 401 error means the LLM provider is not configured correctly. Ensure .env (preferably ~/.vibe-trading/.env) contains:
LANGCHAIN_PROVIDER=deepseek
LANGCHAIN_MODEL_NAME=deepseek-v4-pro
DEEPSEEK_API_KEY=sk-your-deepseek-official-api-key
DEEPSEEK_BASE_URL=https://api.deepseek.com/v1
TIMEOUT_SECONDS=2400
Important:
- LANGCHAIN_PROVIDER must be deepseek, not openrouter.
- Do not mix OpenRouter and DeepSeek keys.
- Vibe-trading reads ~/.vibe-trading/.env first; if that file exists, update it instead of agent/.env.
TroubleshootingWhy does Vibe-Trading CLI swarm fail with '429 billing_not_active' error?
The swarm workers use their own LLM provider configuration, separate from the one used by Codex or single-task runs. The CLI swarm command starts the workflow but internal workers fail because the provider account configured via environment variables (e.g., LANGCHAIN_PROVIDER, LANGCHAIN_MODEL_NAME, DEEPSEEK_API_KEY in agent/.env or shell) is not active or has no billing setup. To resolve, check the agent/.env file, ensure the correct API key is set and that the provider account is active and billing is enabled. Then re-run the swarm command.
TroubleshootingHow to fix "AttributeError: 'object' object has no attribute 'meta'" in the alpha-bench symlink test?
Update the _BenchRegistry test stub in agent/tests/test_mcp_alpha_zoo_contract.py so its returned registry entry includes the meta attribute now required by _validate_bench_data_requirements(). Replace the bare object() return value with SimpleNamespace(meta=None) (importing SimpleNamespace from types if necessary). The validator treats meta=None as having no required columns, allowing the test to proceed to its symlink assertions. Do not widen the production except clause to catch AttributeError, because that could hide real registry contract bugs.
TroubleshootingHow do I fix an options backtest where max_drawdown ignores the first-bar loss from initial cash or reports 0.0?
Upgrade to a release containing the PR fix(options): seed the max-drawdown peak with initial cash. If patching agent/backtest/engines/options_portfolio.py manually, replace the observed-equity peak in _calc_options_metrics:
peak = equity_vals.cummax()
with a peak seeded from valid initial cash:
import numpy as np
if initial_cash is not None and np.isfinite(initial_cash) and initial_cash > 0:
peak = equity_vals.cummax().clip(lower=float(initial_cash))
else:
peak = equity_vals.cummax() # preserve previous fallback/warning
This matches agent/backtest/metrics.py, where initial_cash is the account's first high-water mark before the first recorded bar. After the fix, equity [95, 90, 99] with initial_cash=100 reports max_drawdown=-0.10, and a single observation [90] reports -0.10 instead of 0.0. Add regression tests for first-bar loss, single-bar loss, an all-up equity curve, and invalid initial cash.
TroubleshootingWhy are all orders rejected as zero_size (trade_count: 0) when backtesting BTC-USDT-PERP perpetual symbols?
Root cause: _detect_market() in backtest/engines/_market_hooks.py has no regex for the -PERP suffix, so symbols like BTC-USDT-PERP fall through _MARKET_PATTERNS to the a_share default. The backtest then applies China A-share 100-share board-lot rounding instead of CryptoEngine, rounding every computed position size down to zero — hence unfilled_plan_rejections_by_symbol: {"BTC-USDT-PERP": {"zero_size": N}} and a flat equity curve, even though data loads fine. Fix: add this entry to the crypto section of _MARKET_PATTERNS: (re.compile(r"^[A-Z0-9]+-USDT-PERP$", re.I), "crypto"). Immediate workaround — monkey-patch in-memory before calling runner.main(): import re; from backtest.engines import _market_hooks; _market_hooks._MARKET_PATTERNS.insert(0, (re.compile(r"^[A-Z0-9]+-USDT-PERP$", re.I), "crypto")). With the patch, the same config routes to CryptoEngine, leverage/margin/funding settings apply, and orders size and fill normally. The same root cause affects OKX-style perp symbols (source: "okx").