Discussing the article: "Introduction to MQL5 (Part 41): Beginner Guide to File Handling in MQL5 (III)"
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Check out the new article: Introduction to MQL5 (Part 41): Beginner Guide to File Handling in MQL5 (III).
Learn how to read a CSV file in MQL5 and organize its trading data into dynamic arrays. This article shows step by step how to count file elements, store all data in a single array, and separate each column into dedicated arrays, laying the foundation for advanced analysis and trading performance visualization.
We will first concentrate on understanding how file reading functions in MQL5, as going right into developing the entire indicator could be too much for novices. The focus of this article is on efficiently arranging and correctly reading data from a file. By putting all TradeID values in one array and all LotSize values in another, you will discover how to divide related values into distinct arrays. You will then repeat this process for the remaining columns.
You may recall Part 32, when we talked about working with APIs and grouping data read from a file, if you have been paying close attention to this series. At the time, the primary objective was to understand how APIs function rather than exploring extensively into file handling, and that approach was purposefully beginner-focused. Simpler methods like static arrays and distinct variables for every data collection were therefore used in the instances. Using dynamic arrays, we will adopt a more adaptable and scalable strategy in this post. As a result, we may store as much data as we require without creating a new variable for each value, strengthening the basis for useful and effective file handling in MQL5.
Author: Israel Pelumi Abioye