Vibe-Trading: The Trading Agent That Compiles Prompts Into Strategies
HKUDS built a multi-agent finance workspace that turns natural language into backtests, market-specific code, and cross-platform exports for global trading workflows.
- Vibe-Trading is interesting because it behaves like a compiler pipeline, not a chat interface.
- The system keeps the LLM at the level of strategy design while backtests and exports carry the execution burden.
- Its ReAct loop and layered memory make long trading research sessions survivable instead of brittle.
- The swarm model matters because specialization is built into the product, not bolted on as a prompt trick.
Most AI trading demos stop at summaries, signals, or a chatbot that sounds confident about candles. Vibe-Trading goes after a harder job: turn a plain-language trading idea into artifacts you can actually inspect, backtest, and export. That is why the repo reads less like a trading assistant and more like a compiler for market workflows.
AI-powered multi-agent finance workspace that turns natural language requests into executable trading strategies, research insights, and portfolio analysis across global markets.
Why Vibe-Trading Feels More Like a Compiler Than an Assistant
The core trick is translation. A user describes a strategy in natural language, the system converts that idea into a structured plan, then generates a runnable signal_engine.py, a config.json, and a run directory for the backtest. From there, the workflow can branch into Pine Script v6, MQL5, and TDX exports.
That matters because it narrows where the LLM is allowed to improvise. The model helps shape the strategy, but the math, evaluation, and export layers are handled as artifacts. In other words, the repo tries to make the model useful without asking it to be a calculator.
| Layer | What the user gets | Why it matters |
|---|---|---|
| Prompt | A plain trading idea | Low friction entry for non-quant users |
| Generated code | <code>signal_engine.py</code> | Turns intent into an executable strategy |
| Backtest | Performance evidence | Separates ideas from results |
| Export | Pine Script, MQL5, TDX | Makes the same strategy portable across platforms |
The Pipeline: Prompt, Code, Backtest, Export
The workflow is staged on purpose. Prompt in. Skill selection. Strategy code generation. Backtest execution. Then platform-specific export. That sequence is the repo’s main argument: execution is a pipeline, not a conversation.
run_dir/
config.json
signal_engine.py
backtest_report.json
exports/
strategy.pine
strategy.mq5
strategy.tdx
| Step | LLM's role | Deterministic role |
|---|---|---|
| Strategy design | Propose and refine | None |
| Code generation | Draft the strategy engine | Validate file structure |
| Backtest | Interpret results | Compute the results |
| Export | Map strategy logic | Render target syntax |
The Real Brain Is the ReAct Loop
The engine behind the repo is AgentLoop, and its job is to keep the research thread alive. It uses three context layers. Microcompact trims old tool results, auto-compact summarizes when the token budget gets tight, and manual compact lets the model ask for a cleanup when the transcript gets messy.
That is a practical answer to a real problem. Trading research sessions can be long, noisy, and full of dead ends. The loop is designed so the agent can explore, revise, and keep going without losing the plot.
Skills Are Loaded, Not Stuffed
The skill system follows progressive disclosure. The system prompt only sees short skill descriptions, while the full methodology files are loaded on demand. That is a cleaner design than dumping dozens of research playbooks into the prompt and hoping the model ignores what it does not need.
| Approach | What goes into context | Trade-off |
|---|---|---|
| Stuff everything in | All skills up front | Fast to start, slow to scale |
| Progressive disclosure | Only descriptions first, full docs on demand | More control, less token waste |
| Manual library browsing | Human picks docs outside the agent | Precise, but less fluid |
skills = loader.get_descriptions()
if need_more_detail:
skill_doc = loader.load_skill("chanlun")
context.append(skill_doc)
Why the Swarm Matters
Vibe-Trading is not one monolithic trader. It is a swarm of specialized teams, from a geopolitical war room to an ML quant lab. That choice changes the product from a single assistant into a research desk with distinct functions, which is closer to how real trading teams work.
| Model | Strength | Weakness |
|---|---|---|
| Single generic agent | Simple to explain | Easy to overload |
| Specialized swarm | Role clarity and narrower prompts | More orchestration overhead |
| Human research desk | Strong judgment and review | Slower and less scalable |
Global Markets, Local Heuristics
The repo is broad on purpose. It covers A-shares, crypto, forex, futures, and global equities, and it pulls from loaders like akshare, tushare, ccxt, yfinance, and okx. That mix matters because a trading system only feels universal if its data plumbing understands local market realities.
| Market family | Typical plumbing need | Why the repo’s approach helps |
|---|---|---|
| A-shares | Local data and platform syntax | Supports China-specific workflows |
| Crypto | Exchange APIs and fast iteration | Pairs well with ccxt and exportable signals |
| Forex and futures | Platform-specific execution formats | Makes MQL5 and related targets useful |
| Global equities | Portable research stack | Keeps cross-market comparisons consistent |
Where Vibe-Trading Fits in the Market
Compared with a generic chat-based trading assistant, Vibe-Trading goes further into executable artifacts. Compared with a narrower autonomous executor like VibeTrade, it is less about one broker or one approval flow and more about research, code generation, backtesting, and export. It sits closer to a multilingual quant workshop than to a single-purpose bot.
| Project type | Primary focus | What it optimizes for |
|---|---|---|
| Generic chat assistant | Answers and summaries | Convenience |
| Autonomous executor | Broker-connected action | Controlled execution |
| Vibe-Trading | Prompt to strategy pipeline | Portable research artifacts |
| Traditional quant stack | Manual coding and validation | Full control |
The project is strongest when you treat it as a research-to-code system. It is less convincing as a fully autonomous trader, and that is fine. The real value is that it makes strategy generation portable, inspectable, and fast to iterate.





