Send and receive data via HTTP requests by use the WebRequest function to a WEB/API server.

  • updated
  • Under review

Hi everyone,

I have been using CPEA for a long time and I have developed a statistical data analysis system that I currently use manually alongside the Expert. I often go to change some parameters while it works to improve its operation. Would it be possible to do this automatically by enabling the expert to send and receive data via HTTP requests? you could use the WebRequest function to a WEB/API server. This is done through the MT5 settings, adding the URL to the permission list.

1-The EA sends a request to the API to get the initial or updated parameters.

2-The API receives the request, processes the necessary logic (for example, retrieves the updated parameters from the database), and prepares a response.

3-The API sends a response to the EA, which may include the updated parameters or other relevant information.

The EA receives the response and updates its parameters accordingly, changing its behavior based on the new data.

I think it's a great evolution to be able to make it truly universal.

The WebRequest function in MQL5 is a powerful tool that allows Expert Advisors (EAs) and indicators to send and receive information from external web servers. This can be particularly useful for obtaining real-time data, sending trading signals, retrieving updates on EA parameters remotely, and much more.

Andrey Khatimlianskyi
  • Under review

Hi, Paolo!

Thanks for your suggestion.

Why do you need to change the parameters regularly? Maybe we can automate your strategy instead of the parameters loading?

As for your suggestion. I don’t think this is good idea to implement such a specific function to the EA. What site it should connect to? How to analyze the request? How to check if the new settings are correct and can be applied to the EA? How to warn user if new settings will stop managing existing orders? Too many "hows" and "ifs".

However, you can build an universal tool to load and apply parameters to any EA using the ChartApplyTemplate function (it is easier using this library), if you want. Don’t forget to share it when it is ready 😉