Home / Blog / WebRequest not allowed in MT5: how to add a URL and fix error…

WebRequest not allowed in MT5: how to add a URL and fix error 4014

In short: Add the advisor's exact address in Tools → Options → Expert Advisors under "Allow WebRequest for listed URL" and press OK; error 4014 most likely means it is missing.

WebRequest in MT5: 4014 MT5 blocks an EA’s web calls until its exact URL is on the allowed list
4014 MT5 blocks an EA’s web calls until its exact URL is on the allowed list

MT5 blocks an Expert Advisor's WebRequest calls until the exact address is on a list you control. Open Tools → Options → Expert Advisors, tick Allow WebRequest for listed URL, add the address the advisor calls (for example https://lic.midasgrid.com), press OK, then watch the Experts tab for error 4014, "Function is not allowed for call".

On this page (12)

What does "WebRequest is not allowed" (error 4014) mean?

In MT5, error 4014, "Function is not allowed for call", is what a blocked WebRequest call reports: most likely the address is not on the allowed list, or the call comes from an indicator or the Strategy Tester.

WebRequest() is the MQL5 function that sends an HTTP request. On failure it returns -1 and GetLastError() says why. The runtime-error table lists 4014 as ERR_FUNCTION_NOT_ALLOWED (MQL5 reference, runtime errors, retrieved 8 October 2026).

Three situations can produce it:

  1. The address is not on the list, or the WebRequest option is off. In MetaQuotes' own example, a result of -1 prints a hint that the URL may be missing from the list and has to be added (WebRequest reference). The reference does not tie 4014 to this case in so many words. Forum replies do, and so do some EA developers' setup guides; replies in a thread about the neighbouring socket functions, which also return 4014, point to the same list, though the thread does not record whether that fixed it. So treat this as the likely cause, not a proven one.
  2. The call comes from an indicator. The reference says indicators cannot call WebRequest and get 4014.
  3. The program runs in the Strategy Tester, where the function does not execute; one forum thread shows 4014 there.

The Experts log line is written by the EA's author, so wording differs ("WebRequest is not allowed", "err=4014"). Look for the number.

Why does MT5 block WebRequest by default?

MT5 blocks WebRequest by default: MetaQuotes ships the option switched off "for security reasons" and asks you to name the trusted websites yourself (MetaTrader 5 Help, Expert Advisors options, retrieved 8 October 2026). The risk is easy to see: an EA can read your account number, balance and open trades, and WebRequest can send them anywhere. Think of a front desk with a guest list: the EA may ask to go anywhere, but the desk lets it out only to listed names. Typical uses are license checks, price or news feeds and alerts to a messenger.

How do you allow WebRequest for a URL in MT5, step by step?

To allow WebRequest for a URL in MT5, open Tools → Options → Expert Advisors, tick Allow WebRequest for listed URL, add the exact address the advisor calls and press OK.

  1. Copy the exact address from the EA's documentation. Copy it; do not retype it.
  2. In MT5 open Tools → Options (Ctrl+O), tab Expert Advisors. (Russian build: Сервис → Настройки → Советники.)
  3. Tick Allow WebRequest for listed URL.
  4. Click the line marked "add new URL like 'https://www.mql5.com'", paste the address, press Enter and check that the entry stays in the list.
  5. Click OK.

To remove an entry, select it and press Delete. The trading switch on the same tab (Allow algorithmic trading in current builds; the MetaQuotes Help still calls it Allow Auto Trading) is separate; if that is why the EA is silent, see Automated trading is disabled in MT5.

Which address format mistakes break WebRequest?

The list cannot guess which address you meant, so a wrong entry looks exactly like a missing one. Using the Midas address as the model:

What you enteredWhy it failsDo this
A dropped letter, or .co for .comA different addressPaste, do not type
https://midasgrid.com when the EA calls https://lic.midasgrid.comA subdomain is a separate server; we found no MetaQuotes statement that wildcards workAdd the host the EA calls
http:// for an https:// addressThe scheme sets the port, 80 for http and 443 for https (the reference); we found no statement that one entry covers bothCopy the scheme as documented
https://lic.midasgrid.com/pathThe list holds servers: the hint on the list line and the reference example are scheme plus host, no page pathHost only, unless the vendor says otherwise
Address added, option untickedThe option is off by defaultTick it

Do you need to restart MT5 after allowing a WebRequest URL?

Whether MT5 needs a restart after a WebRequest address is added is unverified: the MetaQuotes pages we read do not say a restart is required, and we found no official statement either way. Some EA developers' guides advise one. A sensible order to try: press OK, then wait for the EA's next request (an advisor that checks hourly will not retry at once), and restart MT5 only if it still fails.

Hold on if positions are open. While MT5 is closed no EA manages them, and the Midas install guide says not to close the terminal while a basket is open.

Why does WebRequest fail in the MT5 Strategy Tester?

The reference states plainly that WebRequest() cannot be executed in the Strategy Tester. A forum poster who had already added the address to the list still saw 4014 in a tester run; a moderator's answer was the tester limit (the thread linked above). An EA with a web license check or data feed therefore cannot use it there, and what it does instead is its author's choice: ask the vendor. Test network code on a demo chart in a live terminal.

Indicators are excluded because they run in one common thread; the reference says a delay in one indicator can stop updating all charts of the same symbol. Move the call into an EA or script.

Do you need to add the URL again on a VPS or a second terminal?

Assume yes: the Options window belongs to one MT5 installation, and we found no MetaQuotes text saying the list is copied between installations, so a VPS terminal, a second broker's terminal and another PC each need their own entry. On a Windows VPS, connect with Remote Desktop, open Options inside that terminal and add the same address (the VPS guide covers the Remote Desktop connection).

If you see 5201, 5202 or 5203 instead of 4014, the call got as far as the network, so look at the connection: outbound HTTPS from the VPS, a firewall, a proxy, a VPN or antivirus that intercepts HTTPS. In one forum thread about a 5203, a reply pointed to the proxy settings (Tools → Options → Server) and to such software; the thread did not reach a confirmed cause. MT5 EA error codes lists the neighbours.

What are you permitting when you add an address?

You let every MQL5 program in that terminal that can call WebRequest, an EA or a script, send requests to that server; the MQL5 Book lists the methods HEAD, GET and POST. The list sits in the terminal's Options window, not in one EA. It says where data may go; the EA's code decides what goes. So:

  • add only addresses you trust and understand, taken from the vendor's own documentation;
  • ask what the EA sends if the documentation is silent;
  • delete entries you no longer use.

This is a different switch from Allow DLL imports, which MetaQuotes advises keeping off for unknown EAs.

How do you check that it worked?

  1. Open the Toolbox (Ctrl+T) and its Experts tab. After the EA's next request there should be no 4014 line.
  2. Read the EA's own status, if it has one.
  3. Run a test script. In MetaEditor choose File → New → Script, paste this, press F7 and drag it onto a chart:
void OnStart()
{
   string url = "https://www.mql5.com";   // use an address that is on your list
   char post[], result[];
   string headers;
   ResetLastError();
   int code = WebRequest("GET", url, NULL, NULL, 5000, post, 0, result, headers);
   Print("HTTP code: ", code, ", GetLastError: ", GetLastError());
}

WebRequest returns the server's HTTP response code, or -1 for a system error (MQL5 Book, as above). Any code, even 404, means the request left the terminal and a server answered. -1 means read the number: 4014, 5200 to 5203.

Example: the Midas license address

We build Midas, an MT5 Expert Advisor for gold that runs on hedging cent accounts. Its install guide (step 6) asks for one list entry, https://lic.midasgrid.com, and the same address is in the LicenseServer input of your .set file (how to load it). Loading the .set file does not add it to the list: the list is a terminal setting.

Midas checks the key on our server at most once an hour. Our privacy page lists what the check carries: account number, license key, advisor version, terminal build and chart symbol, plus the IP address the server sees. It says this is the only request the advisor makes to us and that balance, orders and trade history are not sent.

If the Experts log says WebRequest is not allowed: repeat step 6, check every character (https://, no spaces, nothing after .com). Then, with no basket open, press F3, delete the variables starting with Midas_Lic_ and attach Midas again, or the next check can wait up to an hour. The "If it doesn't work" block of the install guide has the same steps; if the EA is silent for other reasons, see Troubleshooting.

What can go wrong?

  • An address you did not check. A listed server can receive whatever an EA's code sends. Each entry is a permission you grant.
  • A server that is down. The request fails (most likely 5201 or 5202) or comes back with an HTTP error code, and the EA's reaction is its author's choice.
  • A working check says nothing about risk. A green license status means the advisor may run. Martingale-style grid EAs carry risk: with too small a deposit a stop-out is possible; see Risk, plainly.

Sources: MQL5 reference WebRequest() and runtime errors, MQL5 Book "Data exchange with a web server via HTTP/HTTPS", MetaTrader 5 Help, MQL5 forum threads linked above, Midas install guide; all retrieved 8 October 2026. This is a setup guide, not a forecast or individual investment advice. Trading with leverage carries risk: if the deposit is too small, a stop-out is possible. Size your deposit with a safety margin.

FAQ

How do I add a URL to the allowed list for WebRequest in MT5?

Open Tools → Options (Ctrl+O) and the Expert Advisors tab, tick Allow WebRequest for listed URL, click the line "add new URL", paste the exact address the advisor calls, press Enter and click OK. Copy the address from the advisor's documentation, including https://, and add the host only, without a page path, unless its developer says otherwise.

What is error 4014 in MT5?

It is ERR_FUNCTION_NOT_ALLOWED, "Function is not allowed for call". The MQL5 reference names one cause, calling WebRequest from an indicator, and says the function does not run in the Strategy Tester. Forum replies point to an address missing from the allowed list, so check it in Tools → Options → Expert Advisors.

Can I test an EA that uses WebRequest in the MT5 Strategy Tester?

Not the web call itself. The MQL5 reference says WebRequest() cannot be executed in the Strategy Tester, so the address list does not matter there. An EA that needs a web server can be checked on a demo chart in a live terminal. How a given EA behaves in the tester is up to its author.

Why can't my Expert Advisor connect to the server in MT5?

Read the error number first. 4014 points to the allowed list, an indicator or the tester. 5200 means an invalid URL: recheck the characters. 5201 is a failed connection, 5202 a timeout, 5203 a failed request; those suggest a network cause such as a firewall, proxy, antivirus or unreachable server. The list fixes only 4014.

Is it risky to add a URL to the MT5 WebRequest list?

Each entry is a permission: an EA running in that terminal may send requests to that server. The list says where data may go, while the EA's code decides what is sent, and an EA can read your account number, balance and open trades. Add only addresses you trust, taken from the vendor's documentation, and delete entries you no longer use.