2

On my MQL4 Code I need to execute an External url/link in order to update a table,

I have Added the URL in the Allowed URL List Option.

However I got the following error :

enter image description here

Any Idea how to solve this problem ? Thanks .

PS: I am using MT4 Build 840

user3666197
  • 1
  • 6
  • 50
  • 92
koul
  • 431
  • 2
  • 10
  • 20

1 Answers1

3

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...

enter image description here

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
user3666197
  • 1
  • 6
  • 50
  • 92
  • You might already know, @koul that StackOverflow is based on a few principles, shared by the community, one of which is to post so called **MCVE** - a **M**inimum **C**omplete **V**erifiable **E**xample of code ( and date, where needed ), which repeats and demonstrates the problem under review. You may update your post to contain also this important, StackOverflow MCVE compliant, part. **Nevertheless, enjoy being contributing member of this great community.** – user3666197 Jul 09 '15 at 00:38
  • the principals are met I suppose, because you tried to answer my question . If you read well my initial message I think you will find enough information on it , the question is understanding it, do you understand it or not. What you have suggested I have done before my post . – koul Jul 09 '15 at 12:18