Discussing the article: "Introduction to MQL5 (Part 31): Mastering API and WebRequest Function in MQL5 (V)"

 

Check out the new article: Introduction to MQL5 (Part 31): Mastering API and WebRequest Function in MQL5 (V).

Learn how to use WebRequest and external API calls to retrieve recent candle data, convert each value into a usable type, and save the information neatly in a table format. This step lays the groundwork for building an indicator that visualizes the data in candle format.

In the previous articles, we covered the basics of the API and WebRequest function in MQL5. I showed you how to send a request to a server, receive a response, and sort the server response to retrieve important information. Specifically, in the previous article, we retrieved the candle data for the last 5 daily candles of BTCUSDT using the Binance API. We also discussed how to classify related data into separate arrays, such as open, high, low, and close prices. With this organized data, you can build both Expert Advisors and indicators.

In this article, we'll go one step further and work on a more complex project. After sorting the server response, we will extract the crucial candle data from the last 10 thirty-minute candles of BTCUSDT. But we are not just retrieving the data; this article will lay the foundation on how to create an indicator that visualizes the data in candle format. We will first collect the candle information, sort it, and save it into a file before creating a custom indicator that reads this file and uses the saved candle details to display the candles immediately on the chart because indicators cannot use the WebRequest function directly in real time. With this method, we may see the API data inside MetaTrader 5 as a true chart.

Author: Israel Pelumi Abioye