WebRequest EA Setup and External Dependency Risks
Contents (5)
- Bottom Line: Check the URL Registration, the Failure Behavior, and the Scope of Testing
- How WebRequest Works and Its Prerequisites
- Setup and Verification Steps
- 1. Register the Allowed URL
- 2. Check the "Experts" Tab Log Right After Launch
- 3. Apply the Same Setting on the VPS
- 4. Confirm What Happens When Communication Fails
- Limits and Cautions: The Risk of Depending on Outside Services
- Summary
Contents
- Bottom Line: Check the URL Registration, the Failure Behavior, and the Scope of Testing
- How WebRequest Works and Its Prerequisites
- Setup and Verification Steps
- 1. Register the Allowed URL
- 2. Check the "Experts" Tab Log Right After Launch
- 3. Apply the Same Setting on the VPS
- 4. Confirm What Happens When Communication Fails
- Limits and Cautions: The Risk of Depending on Outside Services
- Summary
Bottom Line: Check the URL Registration, the Failure Behavior, and the Scope of Testing
Before using an EA that communicates with an external server, there are three things to check.
- Whether the destination is correctly registered in MT5's "Allow WebRequest for listed URL" list
- How the EA behaves when communication is delayed or fails (does it keep waiting, skip trading, or carry on without the connection?)
- Whether the backtest results were verified with the external integration included
The third is the one most often overlooked. WebRequest does not work in MT5's Strategy Tester. If an EA decides its trades based on external information, the backtest figures reflect a run either "without the external integration" or "with substitute data." You can't take them as-is as the expected performance in live trading.
Recommended Broker Comparison →
🎁 Download Free EA📧 Free 8-email course + subscriber-only pack of 13 MT5 indicators
* Privacy strictly protected. You can unsubscribe at any time.
How WebRequest Works and Its Prerequisites
WebRequest is an MQL5 function that lets an EA or script send and receive data over HTTP/HTTPS. It is used for fetching economic indicators, communicating with signal distribution servers, chat notifications, license authentication, and more.
Key characteristics to keep in mind:
- It can only reach allowed URLs: If the EA tries to send to a destination not on the list, the function fails and returns error code 4014. This can look as though the EA is quietly sitting idle and "doing nothing."
- It runs synchronously: The EA's processing is blocked until a response comes back or the specified timeout (in milliseconds) expires. The EA cannot react to ticks that arrive in the meantime.
- Only EAs and scripts can use it: It cannot be called from indicators.
- It does not work in the Tester: There is no way to reproduce the responses a web server gave at a past point in time.
| Item | What it means | What the user should check |
|---|---|---|
| Allowed URLs | Communication is possible only with registered URLs | Whether the destination given by the developer matches the registered string |
| Timeout | Maximum time to wait for a response | Whether the design can tolerate trading decisions being paused while waiting |
| Tester | Communication is not possible | How the backtest handles the external integration |
| Behavior on failure | Depends on how the EA is built | Whether failures are logged, and how the EA behaves afterward |
Setup and Verification Steps
1. Register the Allowed URL
In MT5, go to "Tools" → "Options" → "Expert Advisors" tab, check "Allow WebRequest for listed URL," and add the destination given in the EA's manual. Enter it starting with "https://", exactly as the developer specifies. A spelling difference or mixing up http and https will directly cause communication to fail. For basic MT5 configuration, see MT5 Setup; for EA-side settings, see How to Configure an EA.
2. Check the "Experts" Tab Log Right After Launch
Once you attach the EA to a chart, check the "Experts" tab and the "Journal" tab in the terminal. If there is no 4014 error or communication failure message, you can conclude the connection is going through. An EA that writes nothing to the log gives you no way of noticing a failure. Before adopting one, it's reassuring to ask the developer whether failures are logged.
3. Apply the Same Setting on the VPS
The allowed URL list is a per-terminal setting. Registering it on your home PC does not carry it over to the MT5 on your VPS. The VPS firewall may also block the connection. For VPS operation, see VPS Information.
4. Confirm What Happens When Communication Fails
To be sure, observe the EA's reaction once, for example by temporarily removing the allowed URL or disconnecting the network. Does it stop opening new trades? Does it keep managing open positions? We believe you should avoid using an EA with real money while you don't know how it behaves in this situation.
Limits and Cautions: The Risk of Depending on Outside Services
External integration is convenient, but it also adds weak points outside the EA itself.
- The other server goes down or its specification changes: If the EA relies on an API that its developer does not control, the EA loses its premise when the service ends or the format changes. Users cannot predict when this might happen.
- Response delays affect execution: A longer timeout means the market keeps moving while the EA waits. A shorter one means more failures. Both have drawbacks, and there is no universally correct value.
- Some parts remain unverifiable: As noted above, WebRequest does not run in the Tester. A forward test on a demo account can confirm behavior including communication, but a short period may never encounter a communication outage.
- What data is being sent: Some EAs send account numbers or balances to external servers. It is hard for the user to see what is actually being transmitted. If you are concerned, ask the developer to confirm what is sent.
An EA is not necessarily excellent because it uses external information, and it is not necessarily inferior because it lacks external integration. We believe that checking whether the EA fails safe when the external connection stops is something to verify before looking at performance figures. For other basics on EAs and MT5, see the Knowledge Hub.
Summary
- WebRequest can only communicate with destinations registered in MT5's allowed URL list (error 4014 if not registered)
- Communication is synchronous, and the EA's processing stops while it waits for a response. The timeout length has both advantages and drawbacks
- WebRequest does not run in the Strategy Tester. Discount the backtest results of EAs that depend on external integration
- On a VPS, register the allowed URLs again and check the firewall as well
- Before adopting an EA, confirm how it behaves when communication fails
- Outages or specification changes at an external service cannot be prevented by the user. Treat this dependency as a risk separate from the EA's own performance
Related
📧 Free 8-email course + subscriber-only pack of 13 MT5 indicators
* Privacy strictly protected. You can unsubscribe at any time.
Have a question about EAs or FX?
You can post it on the Nattzy trading forum (free sign-up). Questions beyond this article are welcome too — EA settings, choosing a broker and more.
Ask on Nattzy ↗