
Mission 1 of 5
Home Hedge Fund, Module 1: Build your own AI hedge fund stack at home
Four free, open-source projects that, put together, look a lot like a real fund: an AI research firm, a team of AI investors, a quant lab from Microsoft and a 24/7 trading bot. This module shows you how they fit, what to install and the order to do it in.
What you'll do
the firm, the fund, the quant lab and the execution
Python, Git and Docker
- A "which tool when" guide and a weekly routine that ties the four together
- A Windows, Mac or Linux computer with at least 8 GB of RAM
- About 20 minutes
- No coding experience. Every command is given to you to copy
Your progress0/6
Meet the four desks
Know what each project does before you install anything.
A real hedge fund has people who research, people who decide, people who test ideas with maths and people who place the trades. You can now run a version of every one of those desks on your own computer, for free, with open-source code that tens of thousands of developers have starred on GitHub.
- The firm: TradingAgents ↗. A whole trading firm made of AI agents. Analysts read the news, the fundamentals, the charts and the social chatter, a bull and a bear argue it out, a trader proposes a move and a risk team plus a portfolio manager sign it off.
- The fund: AI Hedge Fund ↗. AI investors modelled on Warren Buffett, Charlie Munger, Benjamin Graham, Peter Lynch and Stanley Druckenmiller, blended into strategies with hard risk limits, a backtester and paper trading in your terminal.
- The quant lab: Qlib ↗. Microsoft's AI quant research platform. Load market data, build alpha factors, train models like LightGBM and backtest the lot with one command.
- The execution: Freqtrade ↗. A crypto trading bot that runs 24/7. Strategies, backtesting, machine-learning optimisation (hyperopt), dry-run mode, a web dashboard and Telegram control from your phone.
How the four fit together
See the workflow, so each module has a job in your week.
Think of it as a pipeline. Ideas come in at the top, get researched and tested, and only the ones that survive reach the bot.
- 1. Research (TradingAgents). Point the firm at a ticker and get a full report: analyst notes, the bull and bear debate, a trade proposal and a final decision you can read on your phone.
- 2. Decide (AI Hedge Fund). Run the same names past your panel of famous-investor agents. Backtest a mandate against the market and paper trade it one session at a time, with a ledger that builds a real track record.
- 3. Test (Qlib). Check the idea with maths, not vibes. Train a model on 158 ready-made alpha factors and see the annualised return, information ratio and max drawdown of the strategy.
- 4. Execute (Freqtrade). For crypto, turn a rule into a strategy, backtest it, tune it with hyperopt, then let it run in dry-run mode with fake money while you watch it on the dashboard or Telegram.
Set up your computer once
Install the three things every module uses: Python, Git and Docker.
All four projects are written in Python and live on GitHub. Two of them also run neatly in Docker. Install these once and every module after this is copy and paste.
Install Miniconda from anaconda.com/docs/getting-started/miniconda ↗. It gives you Python plus
conda, which keeps each project in its own clean environment. Qlib's own docs recommend it.Install Git: on Windows from git-scm.com ↗, on Mac it comes with the Xcode command line tools.
Windows (PowerShell)winget install --id Git.Git -eMac or Linuxxcode-select --installInstall Docker Desktop from docker.com ↗. Freqtrade's official quick start uses it. On Windows, restart your computer after installing, as Freqtrade's docs recommend.
Open a new terminal (PowerShell on Windows, Terminal on Mac) and check all three:
Check your installsconda --version git --version docker --version
If it breaks"conda" is not recognised on Windows. + 1 more
"conda" is not recognised on Windows.
Docker says the engine isn't running.
Your API keys, done properly
Learn the one habit that keeps your keys safe in every module.
Some modules talk to paid services: an AI model (OpenAI, Anthropic, Google and others) and, for AI Hedge Fund, a market data provider called Financial Datasets. Each guide flags exactly which keys it wants and where they go.
Keys live in a
.envfile, never in your codeA.envfile is a plain text file ofNAME=valuelines that the app reads when it starts. Every module in this course uses one. It looks like this, with your real key after the equals sign:.env (example)OPENAI_API_KEY=paste-your-key-here ANTHROPIC_API_KEY=paste-your-key-here- Never paste a key into a chat, a screenshot or a GitHub repo.
- Set a monthly spending limit in your AI provider's billing page before your first run.
- If a key ever leaks, revoke it in the provider's dashboard and make a new one. It takes a minute.
WarningNot financial advice. Start in paper/dry-run mode.
.env file), and you've set a spending limit on any AI account you plan to use.Which tool when
Know exactly which desk to open for the question in front of you.
Each tool answers a different question. Match the question to the desk:
- "What's going on with this stock or coin right now?" Use TradingAgents. You get analyst reports, a bull and bear debate and a rating from Buy to Sell. Time: a few minutes per ticker. Cost: AI calls, or free with a local model.
- "Would the great investors own this, and how would a fund of them have done?" Use AI Hedge Fund. You get a backtest against SPY, a paper fund and a scorecard. Cost: a data key plus AI calls (a quant-only fund needs no AI).
- "Does this idea hold up across years of data?" Use Qlib. You get IC, annualised return, information ratio and max drawdown for a whole strategy. Cost: free, runs on your own computer.
- "Can a bot trade this rule, day and night?" Use Freqtrade. You get backtests, hyperopt and a dry-run bot you control from Telegram. Cost: free, no keys for dry-run.
The flow
Idea (a headline, a hunch, a chart) goes to TradingAgents for research, then to AI Hedge Fund for a second opinion and a paper position. If it's a repeatable rule rather than one stock, it goes to Qlib (stocks) or a Freqtrade backtest (crypto). Only what survives the test reaches a dry-run bot or your paper fund.
Your home hedge fund week
Leave with a routine, not just four installs.
Here's the weekly rhythm the four modules build towards. Every line below is set up, command by command, in its module. Put the reps in for a few weeks and you'll know these tools better than most people who talk about them online.
- Every weekday, 07:00 (automatic): your TradingAgents morning briefing runs on your watchlist. Read the HTML reports over coffee, decision first, then the bear case. (Module 2)
- Every weekday evening (automatic): your AI Hedge Fund paper fund ticks forward one session. (Module 3)
- Day and night (automatic): Freqtrade runs your crypto strategy in dry-run. Check
/statuson Telegram whenever you like. (Module 5) - Tuesday: put the names TradingAgents liked into your AI Hedge Fund panel and see which investors agree. (Module 3)
- Wednesday: one experiment in Qlib. Swap a model or change a date range and compare the IC and annualised return with last week. (Module 4)
- Thursday: refresh Freqtrade's data and re-run the strategy shoot-out and the lookahead check. (Module 5)
- Friday review:
aihf paper scorecard, Telegram/daily 7and last week's TradingAgents ratings against what prices actually did. Which calls were right, which strategy is earning its keep, what changes next week?
Your checklist for this module
- You know the four desks: research, decide, test, execute
- Miniconda, Git and Docker Desktop installed and printing versions
- A spending limit set on any AI account you'll use
- You've picked the module you'll start with this week
Next up: Module 2 sets up TradingAgents, the firm, and gets your first full AI research report in under 30 minutes.
Your first wins
It works. Now do something with it.
A research desk on your laptop
Full multi-agent reports on any stock or crypto ticker, whenever you want them.
A fund with a track record
A paper fund with a hash-chained ledger, so your results are a real record you can review.
A bot that never sleeps
A crypto strategy running 24/7 in dry-run, controlled from your phone.
Undo it cleanly
How to remove everything this mission installed.
Nothing in this module changes your system beyond installing Miniconda, Git and Docker Desktop. Uninstall any of them from Settings, Apps on Windows, or drag them to the Bin on a Mac.