Terminal permission is part of the setup
MT4 requires destination URLs in the allowed list under Tools, Options, Expert Advisors. A valid source file can still return minus one at runtime when the URL is not allowed, TLS setup fails, DNS is unavailable, or the connection times out.
WebRequest automatically chooses the standard port from the protocol. Use HTTPS for sensitive data and avoid putting secrets in URLs or source files.
| Result | Meaning | Next check |
|---|---|---|
| -1 | MQL4 or transport failure | GetLastError, allowlist, network, timeout |
| 200 to 299 | HTTP success class | Expected body and content type |
| 400 to 499 | Client or authorization response | Request, credentials, rate limit |
| 500 to 599 | Server response | Retry policy and service status |
