2

在我的MQL4代码中,我需要执行外部 url/链接以更新表格,

我在允许的 URL 列表选项中添加了 URL。

但是我收到以下错误:

在此处输入图像描述

任何想法如何解决这个问题?谢谢 。

PS:我使用的是 MT4 Build 840

4

1 回答 1

3

此警告提醒您在您的 MT4 终端( + )中设置(检查 [ x] ref. Fig1)允许这样做Tools->OptionsCtrlO

[允许自动交易(专家顾问本身)] 和 [允许列出 URL 的 WebRequest:/添加格式正确的链接...]

必须将 [ x] 勾选为允许...

在此处输入图像描述

对于任何进一步的问题解决,都需要符合 MCVE 的信息

至少(还没有发布任何相关内容)需要以下部分来重现/验证您在 WebRequest() 调用中指出的问题, (如前所述,StackOverflow 鼓励发布整个 Expert Advisor 代码片段,因此具有完整的上下文,就在问题中,它可以帮助您在询问时形成 StackOverflow 原始帖子的符合 MCVE 的部分。带有擦除 URL 部分的图像不会提供任何有价值的东西来重现您声称有问题的任何错误)

// [A] a WebRequest(): which syntax-mode used + <genetators> / <content-state> of all data-payloads used to execute a WebRequest()-call
// ------------------

   aServerRESPONSE = WebRequest( "GET",
                                 "http://stackoverflow.com/users/3666197/user3666197",
                                 NULL,
                                 NULL,
                                 60000,
                                 aPostPAYLOAD,
                                 0,
                                 aRetResult_STORE,
                                 aRetHeadersSTORE
                                 );

// [A.1] method    [in]-> a HTTP method used in a WebRequest() call.
// [A.2] url       [in]-> a URL  target used in .
// [A.3] headers   [in]-> a string of Request headers in a format of "key: value" pairs, separated by a line break "\r\n".
// [A.4] cookie    [in]-> a Cookie setup value.
// [A.5] referer   [in]-> a Referer header value setup for the HTTP request.
// [A.6] timeout   [in]-> a WebRequest() timeout for sync-waiting in [ms].
// [A.7] data[]    [in]-> a WebRequest() HTTP message body.
// [A.8] data_size [in]-> a size of the data[] array under [A.7].
// [A.9] result[]        <-[out] storage for server response data.
// [A.A] result_headers  <-[out] storage server response headers.


// [B] any value returned from server, once a WebRequest() under [A] was executed
// --------------------

// [B.1] an MQL4-engine <Error-STATE>

   print GetLastError();

// [B.2] a WebRequest()-call's returned value

   print aServerRESPONSE;

// [B.3] as setup under [A.9] aRetResult_STORE

// [B.4] as setup under [A.A] aHeadersSTORE
于 2015-07-08T13:15:49.030 回答