Most traders have a strategy that works. They know their entry, their exit, their risk. But they can’t code.
Hiring a developer? That’s $500 to $2,000 for a single Expert Advisor — with no guarantee it works the way you want. So you head to MQL5, buy some overpriced bot with a photoshopped equity curve, and wonder why it goes silent the moment real money hits the account.
What if you could skip the code entirely?
I built a forex EA robot in under 30 minutes without writing a single line of MQL5. I told an AI my trading strategy in plain English — and it built the entire expert advisor for MT5 before my coffee got cold.
Here’s the full breakdown.
What Is an Expert Advisor (EA)?
Let’s demystify this. An Expert Advisor is not some magical brain. Think of it as a tireless night-shift trader:
- It never sleeps — monitors markets 24/5
- It never panics — no revenge trades, no emotional decisions
- It follows your rules exactly — and reacts faster than any human could
That’s it. No feelings. No hesitation. Just logic, executed perfectly.
The old way meant learning MQL5 — a niche programming language that even experienced developers find painful. Debugging alone could take weeks.
The new way? You describe your strategy to an AI. The AI writes the MQL5 code. You paste it into MT5. You backtest. You deploy.
The 3-Tool Setup
You need exactly three tools. That’s it.
1. VS Code (Free)
A free code editor from Microsoft. You don’t need to understand how it works beyond “paste code here.” Download it from code.visualstudio.com.
2. An AI Assistant
I use Claude with the Claude Code extension, but DeepSeek R1 works too. This is your developer. You’re the architect. It’s the builder.
Important setup step: In VS Code, install the Claude Code extension and give it access to your project folder. This is how the AI can write and edit actual files — not just chat with you, but build real code in real time.
3. MetaTrader 5
Your trading terminal. If you’re reading this, you probably already have it. Open MetaEditor, point it to the same project folder as VS Code, and you’ve got a live pipeline:
Strategy in → AI writes code → MT5 runs it
The Build: From Plain English to Running EA
Here’s the step-by-step workflow that took me three attempts to get right — so you only need one.
Step 1: Describe Your Strategy
Open a new chat in Claude Code and type your strategy. Here’s an example — but use your own strategy, not mine:
You are an MQL5 expert. Build an Expert Advisor with the following rules:
- Instrument: XAUUSD (Gold)
- Timeframe: H1
- Entry: Buy when RSI(14) crosses above 30 AND price closes above the 50 EMA
- Stop Loss: 2x ATR(14) below entry
- Take Profit: 3x ATR(14) above entry
- Position sizing: Risk 1% of account balance per trade
- Max one open position at a time
Step 2: AI Generates the Code
Hit enter. Wait about 15 seconds. The MQL5 code appears in your project folder.
Step 3: Compile in MetaEditor
Copy the
.mq5
file into your MT5
Experts
folder. Open MetaEditor. Hit Compile.
- Green bar = You’re good to go
- Red bar = Copy the error message, paste it back to Claude, and it fixes it. That’s the loop.
Step 4: Deploy
Drag the EA onto a gold chart. Check “Allow algo trading.” Make sure the button at the top is green. When you see the blue icon in the corner — it’s alive.
Total time from idea to running EA: Under 30 minutes.
The Backtest — And the Trap
Now comes the moment of truth. Open the Strategy Tester: H1, last 3 years, every tick based on real ticks.
The equity curve builds. It looks decent. Positive expectancy. Manageable drawdown.
And this is where most traders make the fatal mistake.
Why Win Rate Is a Trap
If your backtest shows a 95% win rate — that’s not a good sign. That’s a red flag. It means your EA memorized the past instead of learning from it.
This is called overfitting. Your EA found patterns that existed in the historical data but won’t repeat in live markets. The equity curve looks like a stairway to heaven. But the moment you run it on a real account? It’s a ghost.
What to Actually Look For
Positive mathematical expectation.
Not win rate. Not profit factor. Ask yourself:
Does this EA make money per trade on average over thousands of trades?
If the average trade is positive, you have an edge. If it’s negative, no amount of optimization will save you.
3 Mistakes That Kill Your First EA
Mistake 1: Forgetting to Enable Algo Trading
You drag the EA onto the chart, you wait, nothing happens. The algo trading button is gray. Click it. It needs to be green. I’ve wasted hours on this one.
Mistake 2: Mixing MT4 and MT5 Syntax
AI sometimes generates MT4 code when you asked for MT5. If you see
OrderSend
instead of
CTrade
in your code, tell the AI to rewrite it for MT5. MT4 is legacy. Don’t start new projects on it.
Mistake 3: Over-Optimizing Your Parameters
You run the strategy tester, you tweak the RSI period from 14 to 13, then 12, then 9. The backtest looks better each time. Congratulations — you just built an EA that only works in the past.
Lock your parameters. Walk-forward test. Leave it alone.
The Complete Workflow
Here’s the full pipeline in one line:
Describe your strategy in plain English → AI builds the MQL5 code → Compile and deploy in MT5 → Backtest with discipline → Run it live with realistic expectations
No coding experience required. Just a strategy worth automating.
Free EA Downloads
If you want battle-tested EA files — not experimental builds — head over to rbot.cc. The tools that actually work are there.
Watch the Full Video Tutorial
Prefer to see the live build with zero cuts? Watch the full walkthrough:
Frequently Asked Questions
Can I really build an EA with zero coding experience? Yes. The AI handles all the MQL5 code. You describe your strategy in plain English. The workflow is: strategy → AI code → compile → deploy.
Which AI works best for MQL5 code generation? Claude with Claude Code extension works best in my testing. DeepSeek R1 is a solid free alternative. Both generate production-ready MQL5 code.
What about ChatGPT? ChatGPT can generate MQL5 code, but it tends to produce more MT4-style syntax and requires more debugging in my experience. Claude Code’s ability to edit files directly in your project folder makes the workflow much smoother.
Is this safe for live trading? Always backtest first. Then run on a demo account. Then run on a small live account. Never deploy an untested EA with significant capital. This is trading — there is always risk.
What’s the difference between MT4 and MT5 EAs? MT5 uses the
CTrade
class for order management. MT4 uses
OrderSend
. The syntax is different and not interchangeable. Always specify MT5 when prompting the AI.
