- posting code in a mql4 forum
- GOLD in a couple of weeks >1000 ?
- MQL4 Learning
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
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).
Forum on trading, automated trading systems and testing trading strategies
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:
- https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
- https://www.w3.org/Protocols/
- http://www.json.org/
- http://www.w3schools.com/json/
- http://www.w3schools.com/xml/
- http://www.w3schools.com/html/
Please note, 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 web protocols.
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):
- Retrieve high impact events from ForexFactory.com and display them in your indicator or Expert Advisor
- FFC - Forex Factory Calendar
NB! However, please note that WebRequest() only works in EA's and Scripts but not in Indicators.

- docs.mql4.com
I've been doing some extensive research these past few days from figuring out how to get mql4 to POST data to a website where PHP will pick up the POST. I've read forums to use webrequest(), but no luck. Thank you in advance!
Try to adopt this example (comments in Russian, use autotranslation feature).

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use