Watch how to download trading robots for free

Interesting script?
So post a link to it -
let others appraise it

You liked the script? Try it in the MetaTrader 5 terminal


Automatic Posting with WebRequest() - script for MetaTrader 5

MetaQuotes Software Corp. | English Русский 中文 Español Deutsch 日本語 Português

votes: 31
2015.01.19 13:23

The WebRequest function has two call options, the first option is used to send simple queries, the example of it is available in the QuotesDemo script.

The second function option allows you to create queries of any type (GET, POST, HEAD, etc.) indicating your own set of headers. This options allows implementing flexible interaction with various Web services. This script is an example of how to post a message on the site.

Warning: avoid sending too frequent automated requests to web sites, because most of sites block too frequent calls. The site also has protection against too frequent requests, and an error in the code may lead to blocking of your account.

When you start the script, enter your login and password.

#property description "Sample script posting a user message "
#property description "on the wall on"

input string InpLogin   ="";             //Your account
input string InpPassword="";             //Your account password
input string InpFileName="EURUSDM5.png"; //An image in folder MQL5/Files/
input string InpFileType="image/png";    //Correct mime type of the image

You may use your own image name in the InpFileName parameter, do not forget to save the image file in the data_folder/MQL5/Files/ and in the InpFileType parameter set the correct MIME type.

Thus, using WebRequest() you can arrange automatic posting of messages containing current market analysis and forecast of probable price actions.


Please note that In the second version of the WebRequest() function, the following parameters passed by the user in the header are ignored, the following values are always used in them:

"Accept-Language: en\r\n"
"Accept-Charset: *,utf-8\r\n"
"Connection: Keep-Alive\r\n"
"Proxy-Connection: Keep-Alive\r\n"
"Pragma: no-cache\r\n"
"Cache-Control: no-cache\r\n",

The Host parameter is also ignored, its value is taken from the URL.

    Translated from Russian by MetaQuotes Software Corp.
    Original code:

    TrendSignal Pro TrendSignal Pro

    The latest version of the TrendSignal indicator. It doesn't repaints and also works well with a template.

    TrendSignal Indicator TrendSignal Indicator

    TrendSignal Indicator for MetaTrader 5.

    Setting Chart Setting Chart

    Setting multiple charts at one click.

    Candle Size Info Candle Size Info

    The indicator shows information about size of candle in pips and size of the shadow too.