Codex
Backtest trading strategies in Codex
Connect LONA to Codex in two commands. Codex writes the strategy, LONA runs the backtests, optimizations and walk-forward tests.
Set it up
- 1
Add the server
The first command registers LONA as a remote MCP server in Codex.
- 2
Log in
The second command opens your browser to sign in with your LONA account.
- 3
Start a session
Open Codex and ask for a strategy. It calls LONA's tools to dry-run, save and backtest it.
codex mcp add lona --url https://mcp.lona.agency/mcp
codex mcp login lonaThen ask
A first prompt to paste once LONA is connected.
Use LONA to backtest a mean-reversion strategy on SPY daily data since 2010: buy when RSI(2) falls below 10, sell when it rises above 70. Then optimize the two RSI thresholds for the Sharpe ratio and show the best region.What your agent can do with LONA
Create strategies
Describe the rules in plain words. The agent writes the Python strategy and dry-runs it before saving.
Backtest
Run it on US and China equities, ETFs, crypto and forex, from 5-minute bars to daily.
Optimize parameters
Sweep one or two parameters and compare every combination.
Walk-forward analysis
Re-optimize on rolling windows and test on data the parameters never saw.
Day and time tests
Find the weekdays or UTC hours your strategy should skip.
[ FAQ ]