How to Create an Expert Advisor for MT4 Without Coding
Short answer: to create an MT4 Expert Advisor without coding, write your
strategy as rules, build those rules in a visual EA builder that generates
MQL4, export the .mq4 file, compile it in MetaEditor 4 (F7), and attach the
resulting .ex4 to a chart with AutoTrading switched on. Test it in the MT4
Strategy Tester and on a demo account before going live.
MetaTrader 4 is still the platform many brokers and traders run, and unlike MT5 it has no built-in wizard that assembles a working strategy — MetaEditor 4's "new Expert Advisor" option gives you an empty template. Here is the full route.
Step 1: Write the strategy as rules
Before touching any tool, write down five things. If you cannot, the EA will not be able to either.
| Rule | Example |
|---|---|
| When to check | Once per closed H1 candle |
| Entry | RSI(14) closes below 30 and no position is open |
| Exit | Take profit 400 points, stop loss 200 points |
| Size | 1% of balance per trade |
| Limits | One position at a time; skip if spread above 25 points |
Step 2: Build it for MT4
In TradeSmithy, a project targets a platform. Create a project, set it to MT4, and start from a template or a blank canvas. The platform matters from the first node: MT4 ships 29 of the 38 standard indicators — DEMA, TEMA, AMA, FrAMA, VIDyA, TriX, Chaikin, Volumes and ADX Wilder are MT5-only. On an MT4 project those appear in the library disabled with the reason shown, rather than silently missing.
Assemble the rules as nodes:
- OnNewCandle set to H1 — the event that starts each check.
- A Technical Indicator node set to RSI, period 14.
- A Positions & Orders node to count open trades.
- Comparison nodes for "RSI < 30" and "open positions = 0", joined by an AND.
- A BUY Order node with lot, stop loss and take profit.
- OnNewCandle End to close the handler.
Step 3: Export the .mq4 file
Press export. The graph is translated into MQL4 — generated with an MQL4-specific prompt, not MQL5 with the names changed — and checked for MQL5 constructs before you download it. If the graph has a problem, such as an assignment wired to no variable, the export is refused and names the node, before anything is spent.
Step 4: Compile in MetaEditor 4
- In MT4, open File → Open Data Folder and go to
MQL4/Experts. - Copy the
.mq4file there. - Open it in MetaEditor (F4 from the terminal) and press Compile (F7).
- Zero errors produces an
.ex4beside it.
Step 5: Attach it to a chart
Back in MT4, right-click Expert Advisors in the Navigator and choose Refresh. Drag the EA onto a chart with the right symbol and timeframe, tick Allow live trading in its settings, and make sure the toolbar's AutoTrading button is on. A smiling face in the chart's top-right corner means it is running and allowed to trade.
Step 6: Test before trusting it
Open the Strategy Tester (Ctrl+R), pick the EA, symbol and dates. MT4 offers three models: Every tick (the most precise), Control points and Open prices only. Use every tick for anything that manages stops inside a bar. Then run it on a demo account for a few weeks.
MT4 traps that compile and trade wrongly
- Points versus pips. On a 5-digit broker, 20 pips is 200 points. Stops in TradeSmithy are in points, which is what MT4 expects.
- Indicator line numbering. In MT4, the Alligator, Gator, Fractals, Envelopes and Ichimoku lines are numbered from 1, while MT5 numbers every buffer from 0. Hand-written MT4 code gets this wrong constantly.
- Bollinger Bands argument order. MT4's
iBandstakes the deviation before the band shift; MT5's takes it after. Swap them and the EA trades on the wrong band without an error. - Symbol suffixes. A broker's
EURUSD.mis notEURUSD. Use the chart's own symbol rather than a typed name.
The generator handles all four; if you ever edit the exported code by hand, keep them in mind. The full list is in MQL4 vs MQL5.
Build your MT4 EA today
Start free on TradeSmithy, set your first project to MT4, and export a
real .mq4 — the Free plan includes the whole builder and one export a month.
Changed your mind about the platform? Switching a project to MT5 rewrites
nothing; it flags anything that will not work there and exports MQL5 instead.
Compare the options in our EA builder comparison.
Frequently asked questions
Can I create an MT4 EA for free?
Yes. TradeSmithy's Free plan builds and exports MT4 EAs, and MetaEditor 4 is free with the terminal.
Does MT4 have an Expert Advisor wizard?
MetaEditor 4 creates an empty EA template. It has no equivalent of MT5's MQL5 Wizard that assembles a working strategy from modules.
Will my MT4 EA run on MT5?
No. .ex4 files only run on MT4. The strategy has to be regenerated as MQL5 —
in a builder, that is a platform switch rather than a rewrite.
Why does my MT4 EA show a sad face on the chart?
AutoTrading is off, or the EA's "Allow live trading" box is unticked. Both must be on.
Keep reading
What Is an Expert Advisor (EA) in Forex Trading?
An Expert Advisor is a program that runs inside MetaTrader and trades by rules. How EAs work, what they can and can't do, and how to get or build one.
4 min readBest Expert Advisor Builders in 2026, Honestly Compared
fxDreema, EA Builder Pro, EA Studio, StrategyQuant X, the MQL5 Wizard, ChatGPT and TradeSmithy compared on what each builds, exports, tests and costs.
7 min readHow to build a MetaTrader Expert Advisor without writing MQL
A node graph is a program. Here is what each node type does, how the connections become code, and what you get when you press export.
4 min read