The AI Loadout

How to build a Trading Bot with an AI agent

Use your coding agent to write and backtest a strategy in an open-source framework like Freqtrade, then run it in dry-run mode with fake money. The agent writes the strategy file and runs the backtests for you. Treat it as a learning project. Results from a backtest do not predict real returns.

Checked against official docs on Oct 26, 2026.

Get the free starter kit. One short email a day when our setups change.

Free starter kit on signup: 2 Claude Code skills and 1 agent persona from our paid packs. By subscribing you agree to get The AI Loadout Daily, one email each morning. No spam, we never sell your email, and every email has a one-click unsubscribe link.

Claude Code

  1. Install Freqtrade from its docs (freqtrade.io)
  2. freqtrade create-userdir --userdir user_data
  3. freqtrade new-config --config user_data/config.json (keep dry_run on)
  4. Ask Claude Code: "Write a simple strategy in user_data/strategies/MyStrategy.py and explain every rule."
  5. freqtrade download-data -c user_data/config.json
  6. freqtrade backtesting -c user_data/config.json --strategy MyStrategy

Codex

  1. Same setup, then ask Codex to write the strategy and run the backtest command
  2. Ask it to list the assumptions behind the result, like fees and slippage

Cursor

  1. Open the user_data folder in Cursor
  2. Ask the agent to write the strategy and add comments
  3. Run freqtrade trade -c user_data/config.json --strategy MyStrategy with dry_run still true

Grok Bot

  1. Ask Grok Bot to explain a strategy idea and check it against Freqtrade's docs
  2. Have it read your backtest output and point out overfitting

Gotchas

  • Backtests overfit easily. A great backtest often fails live.
  • Never give an agent exchange API keys with withdrawal rights.
  • Freqtrade's own README says to start in dry-run and not risk money you cannot lose.

The loadout for this job

FAQ

Can an AI agent build a trading bot?

It can write and backtest strategy code in a framework like Freqtrade. That does not mean the bot will make money.

What is dry-run in Freqtrade?

A mode where the bot trades with simulated money so you can watch it without risk.

Related how-tos

Sources

Commands change. Check the linked docs before you run anything. All how-to guides

Want tested skills and personas installed in one command? See the AI Loadout packs, from $9.