How to Backtest a ChatGPT Trading Strategy on Real MT5 Data
ChatGPT is where a lot of trading ideas start. It is quick, it explains itself well, and it will happily write you a strategy for any market you name. What it can't do on its own is tell you how that strategy would actually have traded.
This guide connects ChatGPT to Trader.AI so it can: your idea becomes exact rules, the rules get backtested on real MT5 data, and the results come back in the same chat.
What you need
- A ChatGPT account, set up on chatgpt.com.
- A free Trader.AI account — you'll create it when you sign in during setup.
On ChatGPT Business and Enterprise, an admin has to turn on Developer mode first.
Step 1: Connect Trader.AI to ChatGPT
- Copy the MCP server URL from the Trader.AI MCP page.
- In ChatGPT, open Settings, then Apps & Connectors, then Advanced, and turn on Developer mode.
- Click Create, name the connector Trader.AI, paste the URL and choose OAuth.
- Sign in to Trader.AI when asked.
Menu names in ChatGPT change from time to time; the MCP page always has the current steps.
Step 2: Describe the idea
Start a new chat with Trader.AI enabled and describe the strategy the way you'd explain it to a friend:
"Buy XAUUSD on the 15-minute chart when price closes above the Asian-session high. Stop below the session low, take profit at twice the risk. One trade per day."
You don't need to fill every gap yourself. Trader.AI pins down what's missing — exact session hours, how risk is sized, what happens if a trade is still open at the end of the day — and ChatGPT tells you what it settled on.
Step 3: Backtest it
Say: "Backtest it."
Free backtests cover all 8 timeframes, with years of history on the long ones. Pro goes up to 9 years on dates you choose — and for an intraday breakout, more history means many more trades to judge it by.
Step 4: Read the result — return is the last thing to look at
ChatGPT returns the headline numbers and a link to the full report. Before you look at return, look at max drawdown. A strategy that made 6% while falling 9% along the way is harder to live with than one that made 4% and never fell more than 2%.
Then open the report and scroll through the trades. Each one shows the rule that opened it and why it closed — stop, target or end of day. If most of the profit came from one or two trades, you have learned something important.
Step 5: Change one thing and run it again
Ask ChatGPT for one change at a time:
- "Move the stop to 1× ATR instead of the session low and backtest again."
- "Only take the trade if the breakout happens before 10:00 London time."
- "Compare this run with the previous version."
Every version is saved in your Trader.AI dashboard, so you can always go back to the one that worked best.
Step 6: Take it to MT5
Happy with a version? On Pro, ask ChatGPT to export it, or download it from your dashboard as an MT5 Expert Advisor. It's built from the exact rules you tested.
Backtests are hypothetical and do not guarantee future results. Test on a demo account before trading real money.
Frequently Asked Questions
Does ChatGPT run the backtest itself?
No. ChatGPT handles the conversation. Trader.AI turns the strategy into exact rules and runs the backtest on real MT5 data, then sends the results back to ChatGPT.
Which ChatGPT plans can connect Trader.AI?
Any plan that supports custom connectors through Developer mode on chatgpt.com. On Business and Enterprise, an admin enables Developer mode first.
Do I need a Trader.AI API key?
No. You sign in with your Trader.AI account once during setup.
Related Resources