Luck has nothing to do with it. It requires good coding skills in MQL and PHP and extensive knowledge with regards to the HTTP protocol.
In fact, the use of the WebRequest() function in MQL is the easiest part. The rest, especially the knowledge about the HTTP protocol, is where you will need to focus the most of your effort and research in order to obtain the necessary knowledge and skills.
Forum on trading, automated trading systems and testing trading strategies
Metatrader 4 to Binary.com
Fernando Carreiro, 2016.09.14 10:04
You must first set permissions on MetaTrader's Options in order to allow access to that website. Go to the "Tools->Options" (or Ctrl+O) and then go to the "Expert Advisors" tab. At the very end of those options, to will find and have to enable the "Allow WebRequest for the listed URL:" and then proceed to add the URL of the site.
NB! Also, depending on the data being retrieved, you may need to use the 2nd version of WebRequest as the first one is only valid for form data (Content-Type: application/x-www-form-urlencoded).
Auto trading the news
Fernando Carreiro, 2016.09.02 00:18
You will have to collect that data from Websites that are offering those services (be they paid or free). You can use the function WebRequest()
to obtain data from the web, but you will have to learn about HTTP, and
depending on the API the website provides, you may also need to learn
REST, JSON or XML or even standard HTML. These web protocols are however beyond the scope of this forum, so for more
information you will have to search the Internet. Here are some links to get you started:
that collecting and parsing Web data via an API, is not something for a beginner or newbie coder. It requires at least
an intermediate level of coding knowledge and good understanding about
I also suggest reading the following threads on here:
EDIT: There are also relevant entries in the Codebase that will be of interest to you (had you done a search):
NB! However, please note that WebRequest() only works in EA's and Scripts but not in Indicators.
Try to adopt this example (comments in Russian, use autotranslation feature).