Edgoro
Platforms

How to install an Expert Advisor on MetaTrader 5 for Mac

Where the MQL5 Experts folder is on a Mac, how to copy an EA with Finder, compile it in MetaEditor or from Terminal, and fix the usual macOS problems.

On a Mac, MetaTrader 5 runs inside Wine, so its Experts folder is at ~/Library/Application Support/net.metaquotes.wine.metatrader5/drive_c/Program Files/MetaTrader 5/MQL5/Experts. Copy your .mq5 or .ex5 file there with Finder, compile it in MetaEditor, refresh the Navigator, then drag the Expert Advisor onto a chart with Algo Trading switched on.

The rest of this guide goes through each step and the places where a Mac behaves differently from Windows. If you use Windows, follow how to install an Expert Advisor on MetaTrader 5 instead.

What is different on a Mac

MetaQuotes ships MetaTrader 5 for macOS as an installer that downloads Wine, a layer that runs Windows programs, and installs the Windows terminal inside it. According to MetaQuotes' installation page for macOS, it needs macOS Catalina 10.15.7 or later and supports every Apple processor from the M1 on. You don't need Parallels or a Windows licence.

Inside the terminal, everything works as it does on Windows. The differences are around it:

WindowsMac
Data folderC:\Users\<name>\AppData\Roaming\MetaQuotes\Terminal\<id>~/Library/Application Support/net.metaquotes.wine.metatrader5/drive_c/Program Files/MetaTrader 5
File → Open Data FolderOpens File ExplorerOpens a Windows-style window drawn by Wine, not Finder
MenusIn the windowAlso in the MetaTrader window, not in the macOS menu bar
F4, F7 and other function keysWork directlyUsually need the Fn key on a Mac keyboard
Program files.mq5 source, .ex5 compiledThe same files; an .ex5 built on Windows runs on a Mac

Step 1: Open the Experts folder in Finder

The Library folder is hidden in Finder, so go to it by path:

  1. In Finder, choose Go → Go to Folder (Shift+Command+G).
  2. Paste this path and press Return:
~/Library/Application Support/net.metaquotes.wine.metatrader5/drive_c/Program Files/MetaTrader 5/MQL5
  1. Open Experts and copy your .mq5 or .ex5 file into it. Sub-folders are fine.

The other program types live next to it:

You haveCopy it to
An Expert Advisor (trades by itself)MQL5/Experts
An indicatorMQL5/Indicators
A script (runs once)MQL5/Scripts
An include file (.mqh) the EA needsMQL5/Include
A parameter file (.set)MQL5/Presets, or load it from the EA's Inputs tab

If you would rather use Terminal, these two commands open the folder in Finder and copy a file from Downloads (change MyEA.mq5 to your file's name):

MT5="$HOME/Library/Application Support/net.metaquotes.wine.metatrader5/drive_c/Program Files/MetaTrader 5"
open "$MT5/MQL5/Experts"
cp ~/Downloads/MyEA.mq5 "$MT5/MQL5/Experts/"

Why not File → Open Data Folder?

On Windows it's the safest way to find the folder. On a Mac it opens a file window that belongs to Wine, and Mac users have reported that copying and pasting into that window fails: see this MQL5 forum thread, with reports from December 2023 to September 2024. Finder writes to the same folder without that problem.

The menu is still useful to check where your installation keeps its data. Wine presents the drive_c folder to the terminal as drive C, so C:\Program Files\MetaTrader 5 in that window is the drive_c/Program Files/MetaTrader 5 folder above.

If the folder isn't there

  • MetaTrader 5 was never opened. Open the terminal once, close it, then look again.
  • An older installation. MetaQuotes' uninstall instructions list two folders in ~/Library/Application Support: net.metaquotes.wine.metatrader5 and Metatrader 5. If the first one is missing, look in the second.
  • A different way of running Windows. If you run the Windows version in Parallels, CrossOver or a virtual machine, the data folder is inside that Windows environment. Use File → Open Data Folder there and follow the Windows guide.

Step 2: Compile the EA

Skip this step if you only have an .ex5: it is already compiled.

  1. In MetaTrader 5, click the IDE button in the toolbar to open MetaEditor. The shortcut is F4; on a Mac keyboard press Fn+F4, unless you've told macOS to use F1, F2 and so on as standard function keys in System Settings → Keyboard.
  2. In MetaEditor's Navigator, open Experts and double-click your file.
  3. Click Compile (F7, or Fn+F7).
  4. Read the Errors tab at the bottom. "0 errors" means MetaEditor wrote an .ex5 next to your .mq5.

If the compiler reports errors, the MQL5 error library explains the common messages. A file ending in .mq4 or .ex4 is for MetaTrader 4 and won't run in MetaTrader 5; see converting MQL4 to MQL5.

Optional: compile from Terminal

MetaEditor also compiles from the command line, which is handy if you edit your code in another editor. With the terminal installed in /Applications:

export WINEPREFIX="$HOME/Library/Application Support/net.metaquotes.wine.metatrader5"
cd "$WINEPREFIX/drive_c/Program Files/MetaTrader 5"
"/Applications/MetaTrader 5.app/Contents/SharedSupport/wine/bin/wine" metaeditor64.exe /compile:'MQL5\Experts\MyEA.mq5' /log
iconv -f UTF-16 -t UTF-8 MQL5/Experts/MyEA.log | tail -1

The first three lines run MetaEditor with the Wine that ships inside the app. The last one prints the final line of the build log, which MetaEditor writes next to the source file in UTF-16. We ran this on 13 November 2026 with MetaTrader 5 build 6275 on an Apple silicon Mac, using the moving average crossover EA from our examples, and the log ended with:

Result: 0 errors, 0 warnings, 902 ms elapsed, cpu='X64 Regular'

If the app is somewhere else, such as ~/Applications, change the path on the third line.

Step 3: Allow algorithmic trading

  1. In MetaTrader 5, open Tools → Options → Expert Advisors and tick Allow algorithmic trading.
  2. Switch on the Algo Trading button in the main toolbar. It's the master switch: when it's off, no EA can trade.

Step 4: Attach the EA to a chart

  1. Open the Navigator from the View menu and expand Expert Advisors. If your EA isn't listed, right-click and choose Refresh.
  2. Open a chart of the symbol and timeframe the EA was written for.
  3. Drag the EA onto the chart.
  4. In the Common tab, allow algo trading for this EA. In the Inputs tab, check the risk, the stop distances and the magic number. Click OK.

The EA's name appears in the top-right corner of the chart. Its messages go to the Experts tab of the Toolbox, and rejected orders to the Journal tab. The Windows guide covers reading the logs and testing in the Strategy Tester in more detail; those parts are identical on a Mac.

Step 5: Keep the Mac awake

An EA runs only while MetaTrader 5 is open and connected. When a Mac goes to sleep, the EA stops managing its trades, and positions that are already open stay open.

  • On a desktop Mac or a MacBook that stays open and plugged in, this Terminal command prevents sleep until you press Control+C: caffeinate -is
  • A MacBook sleeps when you close the lid, whatever the setting, unless it's plugged in and connected to an external display.
  • For an EA that has to run all week, use a VPS, a remote computer that stays on.

Whatever you choose, give every trade a stop-loss held by the broker's server, so that a sleeping Mac never leaves a position unprotected. The MQL5 Expert Advisor risk checklist lists the other checks to make before going live.

Common problems on a Mac

ProblemLikely causeFix
Library doesn't appear in FindermacOS hides itGo → Go to Folder and paste the path from Step 1
Paste does nothing in the Open Data Folder windowThat window belongs to WineCopy the file with Finder or Terminal instead
The EA isn't in the NavigatorWrong folder, or a .mq5 that wasn't compiledCheck it's in MQL5/Experts, compile it, then right-click → Refresh
F4 or F7 changes the brightness or does nothingmacOS uses the key for its own functionHold Fn, or use the IDE and Compile buttons
The EA is attached but never tradesAlgo Trading is off, or a filter blocks entriesCheck the toolbar button, the Common tab and the Experts tab; see 10027 Autotrading disabled
The EA asks for DLL importsIt calls a Windows libraryIt depends on what Wine supports. Leave "Allow DLL imports" off for programs you don't trust, and test on a demo account
Your broker only offers a Windows installerMany brokers don't build a Mac packageInstall MetaQuotes' Mac package, then log in to your broker's server from File → Open an Account
The EA stopped overnightThe Mac went to sleepSee Step 5

Before you trade

Run the EA in the Strategy Tester, then on a demo account for a few weeks, before it touches real money. The Strategy Tester modelling modes explain what each test simulates. If you don't have an EA yet, the MQL5 examples are complete programs you can practise these steps with.

Edgoro writes MetaTrader 5 Expert Advisors from a plain-English description and compiles each one in MetaEditor before you download it, so the .mq5 you copy into the Experts folder already builds. Describe your strategy.

For education, not advice. Trading involves substantial risk of loss. Installing an Expert Advisor doesn't make it profitable; test before you trade.

Frequently asked questions

Where is the MQL5 folder on a Mac?

With MetaQuotes' Mac package it is at ~/Library/Application Support/net.metaquotes.wine.metatrader5/drive_c/Program Files/MetaTrader 5/MQL5. The Library folder is hidden: in Finder, choose Go → Go to Folder and paste the path. Expert Advisors go in MQL5/Experts, indicators in MQL5/Indicators and scripts in MQL5/Scripts.

Can MetaTrader 5 run Expert Advisors on a Mac?

Yes. The Mac version is the Windows terminal running inside Wine, which the installer sets up for you, so Expert Advisors, indicators, MetaEditor and the Strategy Tester are all there. MetaQuotes says it needs macOS 10.15.7 or later and supports every Apple processor from the M1 on.

Does an .ex5 file compiled on Windows work on a Mac?

Yes. The Mac version runs the same Windows terminal, so it loads the same .ex5 files. Copy the file into MQL5/Experts, right-click Expert Advisors in the Navigator and choose Refresh.

Why can't I paste files into the Open Data Folder window on a Mac?

That window is drawn by Wine, not by Finder, and Mac users have reported on the MQL5 forum that copy and paste into it fails. Open the same folder in Finder with Go → Go to Folder and copy the file there.

Do I need Parallels or Windows to use an Expert Advisor on a Mac?

No. MetaQuotes' Mac installer downloads Wine and installs MetaTrader 5 inside it, without a Windows licence. Parallels or a Windows VPS are alternatives, and a VPS is the usual choice for an EA that has to run around the clock.

Does the Expert Advisor keep running when my Mac sleeps?

No. An Expert Advisor runs only while MetaTrader 5 is open and connected. When the Mac sleeps, the EA stops and open positions stay open, so keep the Mac awake or use a VPS, and put a stop-loss on every trade.

Want our studies and guides first when you search? Add Edgoro as a preferred source on Google.

Build it with Edgoro

Describe your strategy in plain English and get a TradingView indicator in Pine Script v6 or a MetaTrader 5 Expert Advisor in minutes. Every first purchase is covered by a 7-day money-back guarantee.

Build your indicator with Edgoro