Insights

How to Backtest a Gemini Trading Strategy on Real MT5 Data

October 27, 20265 min read|By Trader.AI Team

Gemini can draft a trend-following strategy as fast as you can ask for one. The hard part comes afterwards: is the 20/50 crossover better than 10/30? Does the filter help or just cut good trades? Answering that means testing versions side by side, on real data.

Connect Trader.AI to Gemini and you can do it from the chat: Trader.AI makes each version exact, backtests it on real MT5 data and keeps every run so you can compare.

What you need

  • A Google account with Gemini.
  • A free Trader.AI account — you'll create it when you sign in during setup.

Set Trader.AI up on gemini.google.com; it then works in the Gemini mobile app too.

Step 1: Connect Trader.AI to Gemini

  • Copy the MCP server URL from the Trader.AI MCP page.
  • On gemini.google.com, open Settings, then Connected Apps, then Custom apps.
  • Add Trader.AI: name it and paste the URL.
  • Sign in to Trader.AI when asked.

Step 2: Start with a simple version

Trend strategies are easy to over-engineer, so start plain:

"GBPUSD, 30-minute chart. Go long when the 20 EMA crosses above the 50 EMA, short on the opposite cross. Stop at 2× ATR(14), exit on the opposite cross."

Trader.AI fills in what the sentence doesn't say — position size, what happens to an open trade at the weekend — and the report lists every rule it tested.

Step 3: Backtest it

Say: "Backtest it."

Trend strategies trade less often than intraday ones, so a week of data may only produce a handful of trades. Free gives you years of history on the long timeframes, and Pro goes up to 9 years for a fairer picture.

Step 4: Build versions, one change at a time

This is where the workflow earns its keep. Change one thing per run:

  • "Add a filter: only trade when ADX(14) is above 25. Backtest again."
  • "Same, but with a 10/30 EMA cross."
  • "Compare the last three versions: return, max drawdown, number of trades."

Each run is saved as a version in your Trader.AI dashboard. If a filter improves return but halves the number of trades, you'll see both — and you can decide whether the trade-off is worth it.

Step 5: Beware the best-looking version

When you test many variations, one of them will look great by chance. Before you trust it, check that it still makes sense in plain words, that it isn't driven by one or two trades, and that it holds up on a different window.

Step 6: Take it to MT5

On Pro, download the version you've settled on as an MT5 Expert Advisor, 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 Trader.AI work in the Gemini mobile app?

Yes. Add Trader.AI on gemini.google.com and it's available in the mobile app as well.

How many versions can I test?

As many as your backtest quota allows: 20 backtests a month on Free, 200 on Pro. Every version and run is saved in your dashboard.

What is a version?

Each time a strategy's rules change, Trader.AI saves a new version. Renaming a strategy or changing its description doesn't create one.

Related Resources

More Articles

Ready to see verified AI trading in action?

Every Bot on Trader.AI publishes its complete trade history. No fake results. No hidden losses.

View Leaderboard