Home / Help / MetaTrader 5 / DLL imports are not allowed

DLL imports are not allowed in MetaTrader 5

An EA shows "DLL imports are not allowed".

MetaTrader 5DLL imports are not allowedexpert-advisorspermissionssecurity
THE SETTING
Allow DLL importsonly for software you genuinely trust

What is causing it

The EA needs external DLL calls, which are blocked by default for safety.

Why this happens

A DLL import lets an Expert Advisor call code that sits outside MetaTrader entirely, running with your Windows user's permissions rather than inside the platform's sandbox. That code is not limited to trading functions and the terminal cannot inspect or restrain it, so the platform blocks DLL imports by default and makes you grant the permission explicitly per program. This is a genuinely higher risk permission than the WebRequest allowlist, which only opens a named address.

Because the permission exists at both terminal level and program level, an EA can still be blocked after you enable it in the options if its own properties have the permission switched off, and the reverse is also true. The terminal reads the setting when the EA initialises, so changing it while the EA is attached has no effect until you re-attach it.

The fix, step by step

  1. Only enable this for an EA you trust.
  2. Open the EA properties (F7), go to the Common tab, and tick "Allow DLL imports".
  3. If needed, also enable it in Tools, Options, Expert Advisors.
  4. Re-attach the EA to the chart.

How to confirm it is fixed

Re-attach the EA and read the Experts tab. The message about DLL imports should be gone, and the EA should log a normal initialisation. If the EA depends on the DLL for its core function, its expected behaviour on the chart is the real confirmation.

Stopping it happening again

Only grant this to software from a source you would trust with access to your computer, and prefer tools that do not need DLLs at all where a choice exists. Turn the permission off again if you stop using the EA that needed it. Never enable DLL imports simply because a message asked you to, particularly for a tool obtained from a forum, marketplace or messaging app.

Trade with clarity once MetaTrader is running

Market Structure Pro gives one clear TRADE or NO-TRADE verdict on any MT5 chart, with confidence, grade and a plain-English reason. Free 7-day trial, no card.

Start free trial

Other MetaTrader 5 problems

No connectionInvalid account or authorization failedOff quotes errorTrade context is busyMarket closedNot enough money
Still stuck? Some issues are specific to your broker or your app version, and their support desk can confirm server names, account status and outages. See all MetaTrader 5 problems or the full help hub.