Skip to content
All library documents

Fetching and Preparing Binance Candles for MQL5 Charts

Article MQL5 articles

Summary

The article demonstrates a data pipeline for retrieving BTCUSDT candles from Binance and preparing them for use in MetaTrader 5. An expert adviser makes a public API request for the latest ten 30-minute candles, checking for a new local chart bar before requesting again to avoid repeated calls on every tick. The response is split into individual candle records, and price fields are organized into arrays and converted into suitable data types.

The prepared candle data is written to a file so a later custom indicator can read it and draw candles on a chart; the article explains this file-based handoff because indicators cannot call WebRequest directly in real time. The described output is intended as groundwork for visualization, not as a trading signal or strategy. The text offers an implementation example but no reliability, latency, error-handling, or trading performance evaluation, and its manual response parsing approach is specific to the shown API format.

Key ideas

  • Request external candle data only when a new chart interval begins to limit redundant calls.
  • Treat the API response as nested candle arrays and extract each bar's fields into structured data.
  • Store the parsed values in a file for a custom indicator to read and display.
  • The method supports chart visualization but does not provide a trading rule or performance evidence.
  • The article does not evaluate API failures or robustness of its response parsing.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.