Writing a backtest used to mean Python, historical data wrangling, and hours of debugging before you saw a single result. Vibe-Trading — an open-source AI agent from the University of Hong Kong's Data Intelligence Lab — collapses that into a sentence: describe a strategy in plain English and its agents write the code, fetch the data, and run the backtest for you. It's genuinely powerful. It's also finance, so this guide is as much about what a backtest can't tell you as what it can — because the fastest way to lose money is to trust a pretty equity curve.
Difficulty: Intermediate · Required tools: Python 3 and a terminal; the Vibe-Trading repo (free, open-source — HKUDS/Vibe-Trading); and an LLM API key. Optional: your broker's trade history for the bias analysis · Updated: July 2026
Overview
Vibe-Trading is an open-source multi-agent finance workspace (22,000+ GitHub stars) that turns natural-language requests into executable trading strategies, backtests, and analysis across stocks, crypto, and forex. Under the hood it's a team of AI agents plus a large alpha-factor library (460+ factors, built on Qlib); you type "backtest a moving-average crossover on BTC," and it generates the strategy code, pulls the data, runs it, and hands back charts and metrics. It can export strategies to platforms like TradingView (Pine Script) and MetaTrader 5, and — the most interesting part — analyze your own trade history to surface behavioral biases.
Here's the honest frame, because it decides whether this tool helps you or hurts you. A backtest is a hypothesis, not a prophecy. It tells you how a rule would have performed on data that already happened — which is useful for learning and dangerous for predicting. It's trivially easy to produce a gorgeous backtest that falls apart the moment real money and real markets are involved, because past data can be overfit, and live trading adds costs, slippage, and your own emotions that a clean backtest never modeled. Vibe-Trading removes the coding barrier brilliantly; it does not remove market risk, and no tool does.
So where does it genuinely shine? Two places. First, learning — you can test a hundred ideas in the time it used to take to code one, which makes it a fantastic way to understand how strategies behave. Second, and more valuably, self-analysis: its Shadow Account and Trade Journal Analyzer take your real trades and show you where fear and greed cost you — a mirror, not a money printer. Treat it as a research and learning tool and it's excellent; treat it as a signal to bet your rent on, and the math of retail trading will find you.
The honest goal: by the end you'll be able to install Vibe-Trading, backtest a strategy from a plain-English prompt, read the results skeptically (spotting the traps that make a backtest lie), use its strongest feature to study your own biases, and know exactly what to validate before real money is ever at stake — with no illusion that any of this is a guarantee of profit.
Who This Is Useful For
What You Will Learn
What You Need
The 7 Steps
Step 1: Understand what Vibe-Trading is — and what a backtest actually proves
Get the mental model right first. Vibe-Trading is a team of AI agents that turns your words into a runnable strategy and a backtest — it is not an oracle that knows what markets will do. A backtest replays a rule against historical data and reports what would have happened. That's genuinely useful for understanding and comparing ideas, and genuinely misleading if you read it as a forecast. Hold both truths at once: the coding is now free; the certainty is not.
Pro tip: Before you run anything, write down what result would make you suspicious rather than excited — a 90% win rate, a suspiciously smooth curve, huge returns with tiny drawdown. Those are usually signs of a bug or overfitting, not a goldmine. Deciding your skepticism in advance keeps a pretty chart from switching off your judgment.
Step 2: Install Vibe-Trading

Clone the repo and install its dependencies from your terminal:
git clone https://github.com/HKUDS/Vibe-Trading.git
cd Vibe-Trading
pip install -r requirements.txt
Then follow the README to add your LLM API key (the agents need a model to reason with) and any market-data settings. A clean virtual environment avoids dependency clashes. It's an active open-source project, so the README is the source of truth for exact setup — check it rather than any single tutorial, this one included.
Pro tip: Do the whole first run in a throwaway environment with a small data range. You want to confirm the agents, the model key, and the data source all connect before you care about any strategy — debugging setup and strategy at the same time is how people give up in Step 2.
Step 3: Backtest a strategy from a plain-English prompt

Now the payoff. Describe a strategy in natural language and let the agents build and run it — for example:
Backtest a 50/200-day moving-average crossover on BTC/USD
over the last 3 years. Report Sharpe, max drawdown, and win rate.
The agents generate the code, fetch the historical data, run the backtest, and return charts plus metrics. Be specific — asset, timeframe, exact rules, the period — because a vague prompt ("test a strategy") produces a vague, hard-to-trust result. You can lean on its 460+ built-in alpha factors too ("add a momentum factor"), but more knobs also means more ways to accidentally overfit.
Pro tip: Change one thing at a time between runs — the asset, the window, one rule — and keep the rest fixed. If you tweak ten parameters until the curve looks great, you haven't found a strategy; you've fit the noise in one slice of history, and it won't repeat.
Step 4: Read the metrics skeptically — and know the traps

A backtest hands you numbers — Sharpe ratio (risk-adjusted return), max drawdown (worst peak-to-trough loss), win rate — and they're only as honest as the test behind them. Four traps make a backtest lie: overfitting (tuning a rule until it fits past noise); lookahead bias (accidentally using information the strategy couldn't have had at the time); survivorship bias (testing only on assets that still exist, ignoring the ones that went to zero); and missing costs — most backtests exclude trading fees and slippage by default, which can turn a "winner" into a loser. Read every green result as "how might this be wrong?"
Pro tip: Add realistic fees and slippage and re-run before you believe anything. A strategy that trades often can look brilliant with zero costs and bleed to death with real ones — costs are where a huge share of paper-profitable strategies quietly die.
Step 5: Use the Shadow Account to study your own biases

This is where Vibe-Trading is most useful, and least hyped. Feed it your real broker trade history and its Trade Journal Analyzer builds a profile of how you actually trade — holding periods, win rate, PnL ratio, drawdown — and diagnoses behavioral biases. Its Shadow Account extracts the rules implied by your trades and backtests a disciplined version of you, then shows the gap: where fear made you sell the dip, where greed made you overstay. That gap — your behavior versus the rules followed without emotion — is often the single most actionable thing in the whole tool.
Pro tip: Use this feature even if you never build a strategy. Understanding that you consistently exit winners too early or average down into losers is worth more than any backtest — because your biases follow you into every trade, and they're the one variable you can actually control.
Step 6: Validate hard before any real money

A good backtest is a reason to investigate further, never a reason to deploy. Before real capital is involved: test the strategy on out-of-sample data it wasn't tuned on (walk it forward through periods you didn't optimize against); confirm it survives with realistic costs; then paper-trade it live for a meaningful stretch to see how it behaves in real time. If you export to TradingView (Pine Script) or MetaTrader 5, treat that as the start of validation, not the finish line. And if you ever go live, start with an amount whose loss wouldn't hurt.
Pro tip: The single best defense against a lying backtest is out-of-sample testing. Optimize on one slice of history, then test — untouched — on a different slice. If it only works on the data you tuned it on, it doesn't work.
Step 7: Know the limits — this is a learning tool, not a money machine
Keep the honesty that got you here. Vibe-Trading removes the coding barrier to backtesting, which is a real and useful thing — but backtesting itself has hard limits, markets change, and most people who trade actively lose money to costs, taxes, and their own psychology. Use it to learn: to understand strategies, to test ideas cheaply, and above all to see your own biases clearly. What it can't do is tell you the future or make trading safe — no tool can, and any tool that claims to is the one to walk away from.
Pro tip: Judge the tool by how much it improves your understanding and discipline, not by any single backtest's returns. The durable win here isn't a strategy — it's becoming a more skeptical, self-aware trader (or deciding, honestly, that active trading isn't for you).
3 Common Mistakes to Avoid
Going Further
Key Takeaways
Sources: HKUDS/Vibe-Trading — GitHub · HKU Data Intelligence Lab · Vibe-Trading setup guide — knightli