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

 

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

This article will show you how to visualize candle data obtained via the WebRequest function and API in candle format. We'll use MQL5 to read the candle data from a CSV file and display it as custom candles on the chart, since indicators cannot directly use the WebRequest function.

Imagine your indicator as a separate reading area from the library's main hall. Rather than putting your unique candle books on the main library shelf, you build a dedicated shelf in a quiet area so you can see them clearly and separate them from everything else. Focusing on the candle information you are going to display is made easy by this distinct area. You determine how many sections the shelf will require before putting anything on it. You build five sections, since each candle book has four key pages plus an additional page that determines the color of the candle. All the pages will be arranged in these sections. To keep each sort of page correct, you will still require individual compartments, even though the books will be shown as a single collection.

For anyone entering the room to know exactly what they are looking at, you then label the display portion. You decide how the books will look and even designate two colors to show whether the flame is rising or falling. By establishing these guidelines in advance, your reading room will know how to deliver the content once the pages are arranged. You arrange five distinct stacks of pages after establishing the display rules. There are four stacks: one for opening values, one for highs, one for lows, one for closing values, and one for the color markers that decide each candle's appearance. Every stack is ready and ready to be put into the appropriate shelf section.

You meticulously place each stack of pages on the appropriate shelf compartment during the startup process. The exact stack of pages that each compartment will hold and display is now known. The last stack contains the tags that determine the candle's look, while the four-page stacks are utilized to construct the candle body. The reading chamber is ready to receive the candle information when all stacks have been arranged correctly.

Output:

Figure 1. Separate Window

Author: Israel Pelumi Abioye