Cursor
Backtest trading strategies from Cursor
Add LONA to Cursor's MCP config and let the Cursor agent create, backtest and optimize strategies while you work on your code.
Set it up
- 1
Add the config
Paste the snippet into ~/.cursor/mcp.json, or merge the lona entry into the servers you already have.
- 2
Connect
Open Cursor's MCP settings and click Connect next to lona to sign in with your LONA account.
- 3
Ask the agent
In agent mode, ask for a strategy or a backtest. Cursor calls LONA's tools and shows the results.
{
"mcpServers": {
"lona": {
"url": "https://mcp.lona.agency/mcp"
}
}
}Then ask
A first prompt to paste once LONA is connected.
Use LONA to create a breakout strategy on EURUSD 1-hour bars: go long when price closes above the 20-bar high, exit when it closes below the 10-bar low. Backtest the last three years and list the ten largest losing trades.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 ]