Executing an URL from MQL4

落爺英雄遲暮 提交于 2019-12-03 21:49:14

This warning reminds you to set ( check [x] ref. Fig1 below ) permit(s) to do so in your MT4 Terminal Tools->Options ( Ctrl+O )

Both the [Allow automated trading (Expert advisor per se )] and [ Allow WebRequest for listed URL: / Add a properly formatted link...]

must be checked [x] as Allow...

For any further problem resolution, the MCVE-compliant pieces of information are needed.

As a minimum ( there was yet nothing posted about ) the following pieces are needed to reproduce / verify the trouble you indicate having with a WebRequest() call, ( As noted earlier, StackOverflow encourages to post the whole Expert Advisor code-snippet, thus having the full context, right in the question, which helps you to form the MCVE-compliant part of the StackOverflow original post right when asking it. An image with erased URL part does not provide anything valuable for reproducing any error you claim to have problem with ):

// [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
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!