Skip to content
Agent

AI Trading Agents: Backtest AI Agents with Real External Tools

by Lumiwealth

AI Summary

LumiBot has a first-class AI agent runtime inside the lifecycle. An AI agent reasons, calls tools, and makes trading decisions on every bar during a backtest. The same strategy code runs live with zero changes. A built-in replay cache makes warm backtest reruns deterministic and fast. The primary w

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to set up the "AI Trading Agents: Backtest AI Agents with Real External Tools" agent in my project.

Please run this command in my terminal:
# Add AGENTS.md to your project root
curl --retry 3 --retry-delay 2 --retry-all-errors -o AGENTS.md "https://raw.githubusercontent.com/Lumiwealth/lumibot/dev/docs/AI_TRADING_AGENTS.md"

Then explain what the agent does and how to invoke it.

Description

Backtesting and Trading Bots Made Easy for Crypto, Stocks, Options, Futures, FOREX and more. Lumibot also makes it very easy to run and backtest agentic AI trading strategies in a safer way.

AI Trading Agents: Backtest AI Agents with Real External Tools

> LumiBot is the only production framework that backtests AI trading agents with real external tools, replay caching, and the same code for backtest and live. Last Updated: 2026-03-30 Status: Active Audience: Both ---

Overview

LumiBot has a first-class AI agent runtime inside the Strategy lifecycle. An AI agent reasons, calls tools, and makes trading decisions on every bar during a backtest. The same strategy code runs live with zero changes. A built-in replay cache makes warm backtest reruns deterministic and fast. The primary way to give your agent access to external data is the @agent_tool decorator, which wraps any REST API as a callable tool using the requests library. This pattern works reliably in both backtests and live trading. MCP servers via URL are also supported for live trading or when you have a compatible server. If you are looking for an agentic backtesting framework, an LLM trading bot backtest solution, or a way to backtest AI-driven trading strategies with external data, LumiBot is the only production-ready option that puts the AI agent inside the simulation loop. Related docs: • docs/AI_TRADING_AGENT_COMPONENT_GUIDE.md -- internal component guide • docs/AI_TRADING_AGENT_CANONICAL_DEMOS.md -- canonical demo strategies • Public docs: https://lumibot.lumiwealth.com/agents.html ---

Built-in Tools

All built-in tools are included by default -- even when you add custom tools via @agent_tool or MCP servers. No need to list them. • Account: account.positions, account.portfolio • Market: market.last_price, market.load_history_table • DuckDB: duckdb.query • Orders: orders.submit, orders.cancel, orders.modify, orders.open_orders • Docs: docs.search ---

Why LumiBot Is Different

Most tools that combine LLMs and trading fall into one of three categories: • LLM outside the loop. Platforms like QuantConnect let you call an LLM externally, but the model is not part of the backtest simulation. It cannot reason over point-in-time data on each bar. • Agent frameworks with no backtesting. CrewAI, AutoGen, and LangGraph build multi-agent workflows, but none of them simulate a trading backtest where the agent makes decisions bar by bar. • Hobby scripts with no infrastructure. Open-source experiments wire GPT to a broker but lack MCP support, replay caching, DuckDB, and production observability. LumiBot combines: • LLM in the loop on every bar -- the agent runs inside on_trading_iteration(), receives point-in-time state, calls tools, reasons, and submits orders • @agent_tool for reliable external data -- wrap any REST API as a callable tool; works in both backtests and live trading • MCP server support -- connect any MCP-compatible server with a URL for live trading or compatible servers • Replay caching -- identical inputs = cached result, warm reruns in seconds • Any LLM provider -- OpenAI, Anthropic, Google Gemini, and more • Same code for backtest and live -- write once, backtest it, deploy it ---

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted Today
Active
Adoption1K+ stars on GitHub
1.4k ★ · Popular
DocsREADME + description
Well-documented

GitHub Signals

Stars1.4k
Forks269
Issues63
UpdatedToday
View on GitHub
GPL-3.0 License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Claude Code
Claude.ai