I Used AI to Research a Gold EA: What Worked, What Failed and What Surprised Me
I used AI to research a gold EA. Here is what worked, what failed and what surprised me.
I have been quietly running an experiment. I wanted to know whether large language models could really help a developer build a better MetaTrader 5 Expert Advisor.
I did not ask AI to predict the gold price. I used it as a research partner: to suggest ideas, write test code, review my EA and challenge the results.
The experiment changed how I build trading software. It also proved several of my assumptions wrong.
1. AI can create ideas much faster than you can test them
We worked through more than 140 gold strategy ideas. That speed is useful, but it creates a new danger. When you test enough ideas, some will look excellent by luck.
So the rules had to be written before the results were known. An idea had to work in separate test periods, survive small changes to its settings and beat random comparisons. In one research round, only 3 of 65 ideas passed.
Lesson: AI makes ideas cheap. Proper testing is what makes them valuable.
2. Machine learning did not automatically improve the EA
I expected a machine learning trade manager to improve position sizing. We tested two versions by training on past data and checking later data. Neither version was good enough. They beat only 17% and 30% of runs that used shuffled labels, so both were rejected.
Lesson: adding AI to a trading system does not create an edge by itself.
3. Modelling quality can change the conclusion
Testing on OHLC data is fast, but it can hide what happens inside a candle. On one gold scalper I tested, the same four days showed +293 on 1-minute OHLC and -108 on real ticks. Every result published for this EA uses the MetaTrader 5 setting "every tick based on real ticks".
Lesson: a fast test is useful for finding errors. It should not be used to make the final decision.
4. More trades did not mean a better system
I also tried to raise trading activity. We tested 9,605 settings across 40 additional time slots, and none passed the full test on its own. Adding them produced more activity, but the quality per trade fell.
Lesson: higher trade frequency is a choice with a cost. It is not a free improvement.
5. Very high return targets are mainly a risk decision
I asked what it would take to aim for 1,000% a year with this system. The answer was about 7% to 8% risk per trade, with an estimated drawdown of 90% to 95%. No trader should accept that.
Lesson: when a return target looks extreme, first ask how much drawdown it requires.
6. The code audit was the most valuable part
The biggest surprise came from reviewing the code. The audit found 13 bugs in the previous version. One closed open trades when the EA restarted. Another allowed about 2.8% of trades to remain open after the trading day should have ended.
Fixing those bugs changed the backtest results. In one mode, the final balance fell from 8,851 USD to 7,489 USD. That was not the number I wanted to see, but it was the correct number.
Lesson: a clean equity curve means little if the code does not behave as intended.
7. AI still needs human checks
AI wrote convincing explanations, but explanations are not proof. MQL5 automatic validation also found an order problem on a netting account that our own tests had missed. The fix was simple, but the lesson was important.
Lesson: use AI to work faster, then verify everything with the Strategy Tester, independent checks and demo trading.
What came out of this research
The result is Costa Oro Gold Breakout, a fixed-rule gold EA for MetaTrader 5.
- Stop loss on every trade
- No martingale, no grid and no averaging down
- Five risk modes selected from an on-chart panel
- Daily loss protection and a daily closing time
- Published MetaTrader 5 backtest reports for each mode
To be clear, AI was used during research and development. No AI model runs inside the EA, and it does not learn or change by itself. The backtests are simulated, most of the test period was used during development, and the EA has no live trading record yet.
Test it yourself
You do not need to accept my conclusions. Download the free demo of Costa Oro, run it on XAUUSD with real ticks, and look closely at the drawdown as well as the profit.
For release notes, research lessons and answers to common questions, join the Costa Oro Gold EA channel.
I would also like to hear from other developers. Have you used large language models in your trading research? What worked for you, and what failed? Share your experience in the comments.
Trading gold with leverage carries a high risk of loss. Past and simulated results do not guarantee future results. This article is not financial advice.


