PipWardenStart free

What is WebRequest in MT5?

Definition WebRequest is the MQL5 function that lets an Expert Advisor or script send HTTP requests to a web server, and MetaTrader 5 allows it only for addresses listed under Tools → Options → Expert Advisors.

WebRequest is the MQL5 function that lets an Expert Advisor talk to a web server over HTTP or HTTPS. MetaTrader 5 blocks every call unless the server’s address is on the allowed list under Tools → Options → Expert Advisors, so a missing address is one of the most common reasons a server-connected EA sits on a chart and does nothing.

What WebRequest does

EAs use WebRequest to fetch or send data: settings, trade signals, a news calendar, a licence check, reports of closed trades. It is how server-connected EAs and algo trading services link a terminal to their servers. According to the MQL5 documentation:

  • It can be called only from Expert Advisors and scripts, which run in their own threads. Indicators share one thread per symbol (program running), and a call from an indicator fails with error 4014.
  • It is synchronous: the program stops and waits for the answer, up to a timeout it sets in milliseconds.
  • The port follows the protocol: 80 for http://, 443 for https://.
  • It cannot run in the Strategy Tester.
  • It returns the server’s HTTP status code, such as 200, or -1 if the request itself failed.

How to allow a URL in MT5

  1. Click Tools → Options (Ctrl+O) and open the Expert Advisors tab.
  2. Tick Allow WebRequest for listed URL. It is off by default (MT5 help).
  3. Double-click the empty line below it, or click +, and type the address exactly as the EA’s documentation gives it, starting with https://.
  4. Click OK.

The list belongs to the terminal, not to the EA. Every MT5 installation that runs the EA needs its own entry: your home PC, a forex VPS that keeps it running through the market hours, a second terminal for a demo account. For MetaQuotes’ own hosting, the list has to be set up in your terminal before you migrate (migration help).

Error 4014 and the other WebRequest errors

When the address is missing or mistyped, the call fails and GetLastError() typically returns 4014. The network errors have their own codes (MQL5 error codes):

Code MQL5 description Usual cause
4014 Function is not allowed for call Address not on the list, or WebRequest called from an indicator
5200 Invalid URL A malformed address
5201 Failed to connect to specified URL No internet, a firewall, or the server is down
5202 Timeout exceeded A slow server or connection
5203 HTTP request failed Another failure of the request itself

The common mistake is expecting the chart to look broken. It usually does not: the EA sits on the chart as normal, and unless the EA shows its own message, the sign is an error line in the Experts tab of the Toolbox (Ctrl+T). Why an EA is not taking trades walks through this check and the other permissions an EA needs.

Check before you add an address

The list is also a boundary. WebRequest can send data only to the addresses you allow, so an address belongs there only if the EA’s vendor names it and explains what it is for. The install guide shows where the setting sits next to the Algo Trading permissions.

WebRequest and PipWarden

PipWarden’s EA receives its instructions and reports your account over WebRequest, to one address: the one already filled in its ApiUrl input. Until that address is on the list, the EA’s chart panel shows WebRequest not allowed and it cannot receive instructions, so it opens no trades. Adding the address needs no restart.

Because WebRequest cannot run in the Strategy Tester, PipWarden’s EA does not run there either. The dashboard has its own backtest, and a demo account is where the whole setup is tested end to end. The steps are on how it works.

Frequently asked questions

Why does my EA show error 4014?
4014 means “Function is not allowed for call”. For an EA that talks to a server, the usual cause is an address that is missing or mistyped under Tools → Options → Expert Advisors → Allow WebRequest for listed URL. The same code appears when an indicator calls WebRequest, which MT5 does not allow.
Does WebRequest work in the Strategy Tester?
No. The MQL5 documentation states that WebRequest cannot be executed in the Strategy Tester, so an EA that depends on a server has to be tested on a demo account instead.
Which addresses should I add to the WebRequest list?
Only the ones the EA’s documentation names and explains. The list decides which servers the programs in your terminal can send data to, so an address you cannot account for does not belong on it.

Educational content, not financial advice. Forex and CFDs are traded on margin and are high risk: you can lose money, and more than your deposit with some brokers. Examples use made-up numbers and show no real results. Read the risk disclosure.