MetaEditor (MT5)
MetaEditor first‑time setup
Open MetaEditor and compile your first MQL5 script
This guide shows how to open MetaEditor inside MetaTrader 5 (MT5), create a file, paste MQL5 code, and click Compile—everything you need for a first‑time MetaEditor setup.
What is MetaEditor?
MetaEditor is where you write, paste, and compile MQL5 code for MT5. It produces scripts, indicators, or expert advisors you can run in the terminal.
- Open MetaEditor from MT5 via Tools → MetaQuotes Language Editor, or press F4.
- In MetaEditor, you can create a new file (File → New) or open an existing one.
- Paste your code into the editor pane and click the Compile button.
- If compilation succeeds, your compiled file will appear in the Navigator inside MT5 under the correct category (Scripts, Indicators, or Expert Advisors).
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.
Next steps
- Paste your generated code into MetaEditor and click Compile.
- In MT5, refresh the Navigator if needed, then run the script/attach the indicator or EA to a chart.
- Prefer a demo account while experimenting.
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.
- 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.