AI Model Arena Trading Bot (GPT, Gemini, Claude, Grok)¶
Which frontier AI model actually makes better portfolio decisions under the exact same market conditions? This open-ended benchmark challenger gives GPT-6.2 Sol, Gemini 4 Neon, Claude Opus 5.5, and Grok 4.7 the exact same short prompt and full freedom across US stocks, ETFs, leveraged or inverse ETFs, options, and crypto on Alpaca so you can compare their research, trades, and risk control head-to-head.
How it works¶
Every contestant runs the identical strategy class with only parameters["model"] changed:
Research agent reviews current news, macro conditions, market trends, and existing holdings using only information available by today. It identifies at least three distinct, high-conviction opportunities across stocks, ETFs, options, or crypto and challenges whether current holdings still deserve capital or should be rotated.
Trading agent maintains at least three genuinely diversified exposures (deploying 80% to 95% of equity with at most 35% in any single position and reserving cash for option obligations). It sizes orders from current market prices, rotates when stronger setups emerge, and never exceeds available buying power.
Change parameters["model"] to any of the four arena contestants (openai/gpt-6.2-sol, google/gemini-4-neon, anthropic/claude-opus-5.5, or xai/grok-4.7) or keep the default openai/gpt-6-luna for fast, low-cost local smoke tests.
Run it on BotSpot¶
Compare live and backtested AI strategies side by side on BotSpot Marketplace. BotSpot runs LumiBot in the cloud with managed access to frontier models, backtest tear sheets, and broker connections.
Want to run multi-model comparisons directly from Claude, ChatGPT, Codex, or Cursor? Connect the free BotSpot MCP to build, backtest, and inspect agent reasoning traces. Looking for hands-on training on AI trading architecture? Explore BotSpot Courses or join the free AI Trading Challenge.
The code¶
The entire arena challenger fits in roughly 80 lines of Python. Keep the prompts identical across runs so differences in trades and returns reflect model behavior rather than prompt changes.
"""AI Model Arena (Open-Ended Benchmark Challenger).
Identical short prompt for comparing frontier AI models head-to-head on the
same market window: GPT-6.2 Sol ("openai/gpt-6.2-sol"), Gemini 4 Neon
("google/gemini-4-neon"), Claude Opus 5.5 ("anthropic/claude-opus-5.5"), and
Grok 4.7 ("xai/grok-4.7"). Defaults to "openai/gpt-6-luna" for low-cost local
runs; swap parameters["model"] to benchmark any contestant across stocks, ETFs,
options, and crypto on Alpaca.
"""
from lumibot.strategies import Strategy
ARENA_MODELS = (
"openai/gpt-6.2-sol",
"google/gemini-4-neon",
"anthropic/claude-opus-5.5",
"xai/grok-4.7",
)
class AIModelArenaStrategy(Strategy):
parameters = {
"model": "openai/gpt-6-luna",
"reasoning_effort": "medium",
}
def initialize(self):
self.sleeptime = "1D"
model = self.parameters["model"]
effort = self.parameters["reasoning_effort"]
self.agents.create(
name="researcher",
model=model,
reasoning_effort=effort,
allow_trading=False,
allow_network=True,
system_prompt=(
"Goal: help this portfolio achieve 2x to 3x the S&P 500 (SPY) total return on a "
"risk-adjusted basis without reckless risk of ruin. You have full freedom across "
"anything Alpaca supports: US stocks, ETFs, leveraged or inverse ETFs, options "
"(calls, puts, vertical spreads, iron condors), and crypto. Check current news, "
"macro data, market trends, and existing holdings using only information available "
"by today. Identify at least 3 distinct, high-conviction opportunities and "
"challenge whether existing holdings still deserve capital or should be rotated "
"or trimmed. Do not trade."
),
)
self.agents.create(
name="trader",
model=model,
reasoning_effort=effort,
allow_trading=True,
system_prompt=(
"Goal: aim for 2x to 3x SPY return on a risk-adjusted basis without reckless risk "
"of ruin. You may trade any asset class supported by the account: stocks, ETFs, "
"leveraged or inverse ETFs, options (including spreads), and crypto. Maintain at "
"least 3 genuinely diversified exposures (deploy 80% to 95% of equity, max 35% in "
"any single position, reserve cash for option obligations). Size orders from "
"current market prices, actively rotate when better setups appear or a thesis "
"weakens, and never spend beyond available buying power."
),
)
def on_trading_iteration(self):
research = self.agents["researcher"].run(
task_prompt="Review holdings, macro and news catalysts, and best risk-adjusted trades right now.",
context={"previous_notes": self.vars.get("last_notes", "none yet")},
)
self.vars.set("last_notes", research.summary)
self.agents["trader"].run(
task_prompt="Execute the highest-conviction portfolio actions now.",
context={"research": research.summary},
)
if __name__ == "__main__":
from lumibot.credentials import IS_BACKTESTING
if IS_BACKTESTING:
from lumibot.backtesting import AlpacaBacktesting
AIModelArenaStrategy.backtest(AlpacaBacktesting)
else:
AIModelArenaStrategy().run_live()
Run it yourself¶
pip install lumibot
python -m lumibot.example_strategies.ai_model_arena
Configure the provider API key matching the model you select in your .env file:
OPENAI_API_KEYforopenai/gpt-6-luna(default) oropenai/gpt-6.2-solGEMINI_API_KEYforgoogle/gemini-4-neonANTHROPIC_API_KEYforanthropic/claude-opus-5.5XAI_API_KEYforxai/grok-4.7
Also add your Alpaca broker credentials (ALPACA_API_KEY, ALPACA_API_SECRET, and ALPACA_IS_PAPER=true). Set IS_BACKTESTING=true with BACKTESTING_START and BACKTESTING_END to run a historical Alpaca backtest, or IS_BACKTESTING=false to paper-trade or live-trade the exact same strategy class.
Good to know¶
Frontier reasoning models (Sol 6.2, Gemini 4 Neon, Claude Opus 5.5, Grok 4.7) cost more per iteration than
openai/gpt-6-luna. Test a short date range first and inspect_agent_detail.parquetto compare actual tokens, latency, and trade rationale across models.Because the prompt allows leveraged ETFs, options, and crypto, confirm that your Alpaca account has the permissions you want enabled before running live.
Aiming for 2x to 3x SPY return is an open-ended objective for comparing model behavior, not a promise of returns; higher return targets carry higher drawdown risk.
See AI Trading Bot Examples for more AI trading bots and Backtest, paper, or live: choose the runner for backtest and live runners.