MT5 Data Structure

Hello, everyone. I am new to this forum, but I want to ask if is there any documentation out there about Data Structure when extracting data from MT5 using API? I have a sample of extracted data, but I want to create my own documentation for a company that explains the descriptions of each columns. I hope to receive some help. Thank you!
Mat:
Hello, everyone. I am new to this forum, but I want to ask if is there any documentation out there about Data Structure when extracting data from MT5 using API? I have a sample of extracted data, but I want to create my own documentation for a company that explains the descriptions of each columns. I hope to receive some help. Thank you!

Your question is unclear.

What API ? What data structure ? 

If you have a sample, please show it.

Alain Verleyen #:

Your question is unclear.

What API ? What data structure ? 

If you have a sample, please show it.

API is an Application Program Interface, you use it connect with the backend software, specifically to retrieve data. Say I want to retrieve a Trade History for my account in MT5, in a format that a computer can read like JSON() or excel file format, I use API to do that. Data structure refers to how data is being structured, say in excel format there are columns like AccountID, TradeTime, OpenPrice, etc... What I want is a documentation that explains these columns.
Mat #:
API is an Application Program Interface, you use it connect with the backend software, specifically to retrieve data. Say I want to retrieve a Trade History for my account in MT5, in a format that a computer can read like JSON() or excel file format, I use API to do that. Data structure refers to how data is being structured, say in excel format there are columns like AccountID, TradeTime, OpenPrice, etc... What I want is a documentation that explains these columns.

I know what an API and a data Structure are. 

I was asking you concrete information about your issue.

Mat #:
API is an Application Program Interface, you use it connect with the backend software, specifically to retrieve data. Say I want to retrieve a Trade History for my account in MT5, in a format that a computer can read like JSON() or excel file format, I use API to do that. Data structure refers to how data is being structured, say in excel format there are columns like AccountID, TradeTime, OpenPrice, etc... What I want is a documentation that explains these columns.

Aside from Export[ing] chart data in .csv format via the MT5 UI, the MQL5 Data Structures are merely that─programmatic structures. The "structuring" of the .csv (or .xlsx) spreadsheet columns is implemented in your custom file-writing MQL5 code. There is not official MQL5 documentation for every implementation of every coder, but here is a simple example thereof:

Articles

Introduction to MQL5 (Part 40): Beginner Guide to File Handling in MQL5 (II)

Israel Pelumi Abioye, 2026.02.17 14:34

Create a CSV trading journal in MQL5 by reading account history over a defined period and writing structured records to file. The article explains deal counting, ticket retrieval, symbol and order type decoding, and capturing entry (lot, time, price, SL/TP) and exit (time, price, profit, result) data with dynamic arrays. The result is an organized, persistent log suitable for analysis and reporting.

Ryan L Johnson #:

Aside from Export[ing] chart data in .csv format via the MT5 UI, the MQL5 Data Structures are merely that─programmatic structures. The "structuring" of the .csv (or .xlsx) spreadsheet columns is implemented in your custom file-writing MQL5 code. There is not official MQL5 documentation for every implementation of every coder, but here is a simple example thereof:


Thank you!

There is no universal column layout because orders, deals and positions are different records in MT5. For a company document I would keep separate tables, then link them by position ID and order ticket. Also store time in UTC plus milliseconds, otherwise fills made in the same second can be sorted wrong