Intro to MetaEditor
MetaEditor 5 is the code editor and MQL5 compiler built into MetaTrader 5. It's where you write or paste MQL5, press Compile, and turn a text file into an Expert Advisor, indicator or script that MT5 can run. Open it with F4 from the terminal. This page is the overview; the focused guides below each cover one job end to end.
Start here
- How to open MetaEditor in MT5: F4, the Tools menu, the IDE button, and what to do when F4 does nothing
- Downloading and installing MetaEditor 5: there's no standalone download; it ships with MT5
- Compiling MQL5 from the command line:
metaeditor64.exe /compile, the flags, and build scripts
Paste, compile, deploy
- Open MetaEditor — F4, or see the four ways in if F4 does nothing.
- File → New (or open the exported
.mq5), paste the full code, click Compile (F7). - If compilation succeeds, the compiled file appears in MT5's Navigator under Scripts, Indicators, or Expert Advisors.
What the window looks like
MetaEditor opens as its own window, separate from the MT5 terminal, laid out in three parts:
- Navigator (left): the
MQL5folder tree:Experts,Indicators,Scripts,Include,Files. - Editor (centre): the code, with syntax highlighting and one tab per open file.
- Toolbox (bottom): the Errors tab lists compile errors and warnings with clickable line numbers, alongside the Search and MQL5 community tabs.
The toolbar across the top carries Compile (F7), New (Ctrl+N) and the debugger controls. If you've used any modern IDE the layout will be familiar; the only MT5-specific part is that the Navigator tree mirrors your terminal's data folder on disk.
Where compiled files go
- Scripts compile to
MQL5/Scripts - Indicators compile to
MQL5/Indicators - Expert Advisors compile to
MQL5/Experts
You can see these folders in the MetaEditor Navigator and in MT5’s Navigator.
Troubleshooting
- Can't log in: verify server (Demo vs Real) and credentials.
- No servers listed: close and reopen MT5, or use your broker's installer.
- F4 does nothing: use Tools → MetaQuotes Language Editor instead (see how to open MetaEditor in MT5).
- Compile errors: check the Messages pane in MetaEditor for exact error lines.
- Can't find compiled file: confirm you compiled the correct type and look under the matching folder in Navigator.
Next steps
-
Paste your exported
.mq5into MetaEditor and click Compile. -
In MT5, refresh the Navigator if needed, then attach the EA or indicator to a chart.
-
Prefer a demo account while experimenting.
-
How to open MetaEditor in MT5: every way in, plus when F4 does nothing
-
Downloading and installing MetaEditor 5: it ships with MT5
-
Compiling MQL5 from the command line: for build scripts
-
Backtesting in the MT5 desktop app: test the compiled EA
-
Using the Journal: read Strategy Tester errors
-
Setting up MetaTrader 5: install and log in first