Native MT5 Bars CSV export — OHLC decimal and timestamp semantics

Hello,

I am conducting private local research/backtesting using the native MetaTrader 5 workflow:

Symbols → Bars → Request → Export Bars / CSV

I would like to clarify the technical semantics of this native GUI export, not a custom MQL5 exporter.

Could you please confirm, or point me to official MetaQuotes documentation covering:

  1. The source fields/representation used for OHLC values in the native Bars CSV export.
  2. The meaning of the exported decimal values, including decimal separator/locale behavior, precision, and any rounding or truncation behavior.
  3. The price basis and construction semantics of OTC bars used by this exporter.
  4. The meaning of timestamps written by the native Bars CSV exporter, including the applicable time domain/timezone.
  5. Whether these rules depend on the terminal build/version.
  6. If the exported Spread field is relevant, its unit and aggregation semantics.

Please distinguish native GUI Bars-export behavior from custom MQL5 scripts or APIs.

No raw market data or account credentials are being provided.

Thank you.

AI are funny, they request human to give them the answers they should know or be able to find.
Alain Verleyen #:
AI are funny, they request human to give them the answers they should know or be able to find.

😅

Confirmed by the MQL5 Lite AI Assistant (MT5 Build 6201, Metaquotes Demo account):

Native MetaTrader 5 "Bars → Request → Export CSV" — Technical Semantics

I verified this against the official MetaTrader 5 Terminal Help (current online documentation from MetaQuotes, English) and the MQL5 Reference. Summary first: the core semantics are officially documented and stable (minute-bar storage, Bid vs Last price basis, server-time timestamps, spread in points), while the byte-level CSV formatting (delimiter/encoding) is not specified in the docs and should be verified per build.


1. Which GUI feature you are using (and its official doc)

This is the "Downloading price history" feature under Terminal Help → Trading Operations → Market Watch:

"To download data, open the symbol management dialog in the 'Market Watch' context menu and switch to the Bars or Ticks tab. Select a symbol and a timeframe, and click Request. The platform requests all available data from the server or displays them immediately if they have already been downloaded. Click Export to save price data as a CSV file."

That matches your Symbols → Bars → Request → Export Bars / CSV flow. The same section also notes you can export current chart data via File → Save.

📄 https://www.metatrader5.com/en/terminal/help/trading/market_watch#history

2. OHLC source fields / representation

    • The terminal stores only 1-minute bars locally ("The entire history of quotes in the trading platform is stored in the form of minute bars. All other timeframes are based on them"). Timeframes higher than M1 are aggregated from M1 bars on request, not downloaded separately.
    • The documented CSV bar layout is: Date Time Open High Low Close TickVolume Volume Spread , for example:

<DATE> <TIME> <OPEN> <HIGH> <LOW> <CLOSE> <TICKVOL><VOL> <SPREAD> 2016.06.27 00:01:00 1.10024 1.10136 1.10024 1.10070 18 54000000 44

    • This is the same layout the official docs use for price-history import into custom symbols; the help explicitly says "You can use data from any existing instrument for your custom symbol. Export data, modify it if necessary, and import the data back" — i.e., the Bars export is the mirror image of that format.
    • The underlying in-memory structure is documented as MqlRates : time (datetime), open/high/low/close (double), tick_volume (long), spread (int), real_volume (long).

📄 https://www.metatrader5.com/en/terminal/help/trading_advanced/custom_instruments#import_history 📄 https://www.mql5.com/en/docs/constants/structures/mqlrates

3. Decimal values — precision, separator, rounding

    • Precision: Prices are written with the symbol's configured precision — the "Digits" field in the specification ("Digits — number of decimal places in the price of the symbol"). OHLCV values are the stored price values formatted to that precision.
    • Separator: The official format examples use dot as decimal separator ( 1.10024 ). However — and this is important — the terminal help does not formally document the field delimiter or encoding of the exported file, nor does it promise locale independence. The import dialog has an explicit "Separator" option because the terminal reads arbitrary text files; the export side writes its own file, and that exact byte format has historically differed between CSV outputs/builds in MetaTrader (comma vs. semicolon vs. tab; dot vs. comma decimals depending on Windows locale). Practically, on current builds you should expect dot decimals; verify the first row of your own exported file.
    • Rounding/truncation: There is no official statement of an explicit truncation rule. The values are terminal-stored doubles written with symbol-precision formatting; treat any extra decimal digits you see as formatting artifacts, not as additional data resolution. If you need guarantees, the deterministic source of truth is CopyRates (raw doubles) or CopyTicks (raw ticks) via MQL5 — see §8.

4. OTC bars — price basis and construction (officially documented)

The Terminal Help → Price Data page defines three prices (Bid, Ask, Last) and states:

    • OTC market: only Bid/Ask stream quotes are used — "without data on actual executed deals" — and charts are based on Bid prices.
    • Exchange market: quotes and deal data come from the exchange; charts are based on Last prices.
    • Bar construction: "One-minute bars are formed based on symbol quotes (or ticks)… One-minute bars are based on Bid prices for OTC symbols, and are based on Last prices for exchange instruments." A minute bar contains: 4 prices (Open/High/Low/Close), the spread (minimum Bid–Ask difference in that minute), tick volume (number of ticks), real volume ("may be not available for OTC markets"), and the minute's date/time.
    • The per-symbol "Chart mode" in the Specification ("by last deal prices (Last) or by Bid prices") drives this per symbol.

So for your OTC research data: OHLC = Bid-built bars, no Last, real volume typically absent, Higher TFs = aggregates of those Bid-based M1 bars. Ask data only survives as the per-bar Spread value.

📄 https://www.metatrader5.com/en/terminal/help/trading_advanced/price_data

5. Timestamps — meaning and time domain

    • Bar time = the opening time of the period (the minute to which the bar corresponds), format YYYY.MM.DD + HH:MM:SS in the CSV.
    • Time domain = the brokerage trade-server time zone, not your PC's local time and not UTC. Official statement: the quote arrival "Time" field is "Specified according to the time zone of the broker's trading server" (Market Watch help). This is consistent with the MQL5 data model, where all timeseries/ datetime values are in trade-server time (that is also why the import dialog has a "Shift — time shift by hours… used when importing data saved in a different time zone").
    • MT5 server time has no DST (server clocks run on a fixed offset), so exported timestamps are stable/reproducible in that domain — convert to UTC only if you know your broker's fixed server offset.

6. Build/version dependence

    • The feature itself (Bars/Ticks dialog + Request + Export) is documented in the current official help and is present across recent terminal builds; there is no official per-build contract for the CSV byte format.
    • Release notes show MetaQuotes repeatedly touching CSV/history handling in different builds (import fixes, CSV-related improvements, tester history downloading changes) — so treat CSV layout as stable-but-unspecified, and delimiter/encoding as potentially version- and locale-dependent.
    • Practical rule for research integrity: record the terminal build (Help → About) and the broker server name together with each exported dataset, and re-verify a one-row sample after any terminal upgrade.

7. The Spread field

    • Unit: points (official specification: "Spread — spread in points", where a point is the symbol's minimum price-change step; for 5-digit FX quotes 1 point = 1/10 of a pip).
    • Aggregation semantics (official, M1): the spread stored in a bar is "the minimum difference between Bid and Ask recorded during one minute" — i.e., the tightest spread seen in that minute, not an average and not a snapshot.
    • For higher timeframes, the documentation's rule is that all higher TFs are created from M1 bars, so expect the same minimum-type aggregation carried up; the docs do not spell out the H2/D1 spread aggregation explicitly — if your research depends on it, cross-check by exporting M1 and the higher TF for the same interval.

8. Native GUI export vs. MQL5 scripts/APIs (explicit distinction)

Aspect Native GUI export (Bars → Request → Export) Custom MQL5 (CopyRates / CopyTicks + file write)
Formatting Fixed by terminal; not configurable Fully under your control (separator, precision, locale)
Rounding Formatted to symbol digits by the terminal Raw double values from CopyRates ; you decide normalization
Updating One-shot file at export time On-demand, scriptable, mergeable into pipelines
Tick granularity Ticks tab exports Date/Time/Bid/Ask/Last/Volume + flags Full MqlTick incl. time_msc , flags
Documented contract Field order documented; delimiter/encoding not MqlRates/MqlTick structure is the documented contract
Locale behavior Terminal-dependent FileWrite CSV behavior is MQL5-specified (and locale-sensitive on Windows)

Both read the same underlying terminal history (server-downloaded M1 bars / ticks); the difference is purely access path and formatting. One caution: the export is a manual GUI facility, not a stable interchange API — MetaQuotes has not committed to a byte-level format, whereas CopyRates semantics are part of the MQL5 reference contract.

📄 https://www.mql5.com/en/docs/series (overview) · https://www.mql5.com/en/docs/series/copyrates · https://www.mql5.com/en/docs/series/copyticks 📄 https://www.mql5.com/en/book/applications/timeseries/timeseries_storage_tech (HCC/HC storage)


Bottom line for your research workflow

    • Your exported CSVs are Bid-based (OTC) or Last-based (exchange) M1-derivative bars, server-time, with spread in points (minimum per bar), prices at symbol digits — these semantics are official and stable across builds.
    • The delimiter/encoding and any locale effects of the CSV file itself are not documented — do a one-row sanity check per terminal build and record the build + broker in your research metadata.
    • Nothing here required access to your terminal, account, or market data; this is documentation-only verification. I can help further, e.g., by writing an MQL5 CopyRates -based exporter that guarantees format stability if you ever want to replace the GUI export
Ryan L Johnson #:

😅

Confirmed by the MQL5 Lite AI Assistant (MT5 Build 6201, Metaquotes Demo account):

Native MetaTrader 5 "Bars → Request → Export CSV" — Technical Semantics

I verified this against the official MetaTrader 5 Terminal Help (current online documentation from MetaQuotes, English) and the MQL5 Reference. Summary first: the core semantics are officially documented and stable (minute-bar storage, Bid vs Last price basis, server-time timestamps, spread in points), while the byte-level CSV formatting (delimiter/encoding) is not specified in the docs and should be verified per build.


1. Which GUI feature you are using (and its official doc)

This is the "Downloading price history" feature under Terminal Help → Trading Operations → Market Watch:

"To download data, open the symbol management dialog in the 'Market Watch' context menu and switch to the Bars or Ticks tab. Select a symbol and a timeframe, and click Request. The platform requests all available data from the server or displays them immediately if they have already been downloaded. Click Export to save price data as a CSV file."

That matches your Symbols → Bars → Request → Export Bars / CSV flow. The same section also notes you can export current chart data via File → Save.

📄 https://www.metatrader5.com/en/terminal/help/trading/market_watch#history

2. OHLC source fields / representation

    • The terminal stores only 1-minute bars locally ("The entire history of quotes in the trading platform is stored in the form of minute bars. All other timeframes are based on them"). Timeframes higher than M1 are aggregated from M1 bars on request, not downloaded separately.
    • The documented CSV bar layout is: Date Time Open High Low Close TickVolume Volume Spread , for example:

<DATE> <TIME> <OPEN> <HIGH> <LOW> <CLOSE> <TICKVOL><VOL> <SPREAD> 2016.06.27 00:01:00 1.10024 1.10136 1.10024 1.10070 18 54000000 44

    • This is the same layout the official docs use for price-history import into custom symbols; the help explicitly says "You can use data from any existing instrument for your custom symbol. Export data, modify it if necessary, and import the data back" — i.e., the Bars export is the mirror image of that format.
    • The underlying in-memory structure is documented as MqlRates : time (datetime), open/high/low/close (double), tick_volume (long), spread (int), real_volume (long).

📄 https://www.metatrader5.com/en/terminal/help/trading_advanced/custom_instruments#import_history 📄 https://www.mql5.com/en/docs/constants/structures/mqlrates

3. Decimal values — precision, separator, rounding

    • Precision: Prices are written with the symbol's configured precision — the "Digits" field in the specification ("Digits — number of decimal places in the price of the symbol"). OHLCV values are the stored price values formatted to that precision.
    • Separator: The official format examples use dot as decimal separator ( 1.10024 ). However — and this is important — the terminal help does not formally document the field delimiter or encoding of the exported file, nor does it promise locale independence. The import dialog has an explicit "Separator" option because the terminal reads arbitrary text files; the export side writes its own file, and that exact byte format has historically differed between CSV outputs/builds in MetaTrader (comma vs. semicolon vs. tab; dot vs. comma decimals depending on Windows locale). Practically, on current builds you should expect dot decimals; verify the first row of your own exported file.
    • Rounding/truncation: There is no official statement of an explicit truncation rule. The values are terminal-stored doubles written with symbol-precision formatting; treat any extra decimal digits you see as formatting artifacts, not as additional data resolution. If you need guarantees, the deterministic source of truth is CopyRates (raw doubles) or CopyTicks (raw ticks) via MQL5 — see §8.

4. OTC bars — price basis and construction (officially documented)

The Terminal Help → Price Data page defines three prices (Bid, Ask, Last) and states:

    • OTC market: only Bid/Ask stream quotes are used — "without data on actual executed deals" — and charts are based on Bid prices.
    • Exchange market: quotes and deal data come from the exchange; charts are based on Last prices.
    • Bar construction: "One-minute bars are formed based on symbol quotes (or ticks)… One-minute bars are based on Bid prices for OTC symbols, and are based on Last prices for exchange instruments." A minute bar contains: 4 prices (Open/High/Low/Close), the spread (minimum Bid–Ask difference in that minute), tick volume (number of ticks), real volume ("may be not available for OTC markets"), and the minute's date/time.
    • The per-symbol "Chart mode" in the Specification ("by last deal prices (Last) or by Bid prices") drives this per symbol.

So for your OTC research data: OHLC = Bid-built bars, no Last, real volume typically absent, Higher TFs = aggregates of those Bid-based M1 bars. Ask data only survives as the per-bar Spread value.

📄 https://www.metatrader5.com/en/terminal/help/trading_advanced/price_data

5. Timestamps — meaning and time domain

    • Bar time = the opening time of the period (the minute to which the bar corresponds), format YYYY.MM.DD + HH:MM:SS in the CSV.
    • Time domain = the brokerage trade-server time zone, not your PC's local time and not UTC. Official statement: the quote arrival "Time" field is "Specified according to the time zone of the broker's trading server" (Market Watch help). This is consistent with the MQL5 data model, where all timeseries/ datetime values are in trade-server time (that is also why the import dialog has a "Shift — time shift by hours… used when importing data saved in a different time zone").
    • MT5 server time has no DST (server clocks run on a fixed offset), so exported timestamps are stable/reproducible in that domain — convert to UTC only if you know your broker's fixed server offset.

6. Build/version dependence

    • The feature itself (Bars/Ticks dialog + Request + Export) is documented in the current official help and is present across recent terminal builds; there is no official per-build contract for the CSV byte format.
    • Release notes show MetaQuotes repeatedly touching CSV/history handling in different builds (import fixes, CSV-related improvements, tester history downloading changes) — so treat CSV layout as stable-but-unspecified, and delimiter/encoding as potentially version- and locale-dependent.
    • Practical rule for research integrity: record the terminal build (Help → About) and the broker server name together with each exported dataset, and re-verify a one-row sample after any terminal upgrade.

7. The Spread field

    • Unit: points (official specification: "Spread — spread in points", where a point is the symbol's minimum price-change step; for 5-digit FX quotes 1 point = 1/10 of a pip).
    • Aggregation semantics (official, M1): the spread stored in a bar is "the minimum difference between Bid and Ask recorded during one minute" — i.e., the tightest spread seen in that minute, not an average and not a snapshot.
    • For higher timeframes, the documentation's rule is that all higher TFs are created from M1 bars, so expect the same minimum-type aggregation carried up; the docs do not spell out the H2/D1 spread aggregation explicitly — if your research depends on it, cross-check by exporting M1 and the higher TF for the same interval.

8. Native GUI export vs. MQL5 scripts/APIs (explicit distinction)

Aspect Native GUI export (Bars → Request → Export) Custom MQL5 (CopyRates / CopyTicks + file write)
Formatting Fixed by terminal; not configurable Fully under your control (separator, precision, locale)
Rounding Formatted to symbol digits by the terminal Raw double values from CopyRates ; you decide normalization
Updating One-shot file at export time On-demand, scriptable, mergeable into pipelines
Tick granularity Ticks tab exports Date/Time/Bid/Ask/Last/Volume + flags Full MqlTick incl. time_msc , flags
Documented contract Field order documented; delimiter/encoding not MqlRates/MqlTick structure is the documented contract
Locale behavior Terminal-dependent FileWrite CSV behavior is MQL5-specified (and locale-sensitive on Windows)

Both read the same underlying terminal history (server-downloaded M1 bars / ticks); the difference is purely access path and formatting. One caution: the export is a manual GUI facility, not a stable interchange API — MetaQuotes has not committed to a byte-level format, whereas CopyRates semantics are part of the MQL5 reference contract.

📄 https://www.mql5.com/en/docs/series (overview) · https://www.mql5.com/en/docs/series/copyrates · https://www.mql5.com/en/docs/series/copyticks 📄 https://www.mql5.com/en/book/applications/timeseries/timeseries_storage_tech (HCC/HC storage)


Bottom line for your research workflow

    • Your exported CSVs are Bid-based (OTC) or Last-based (exchange) M1-derivative bars, server-time, with spread in points (minimum per bar), prices at symbol digits — these semantics are official and stable across builds.
    • The delimiter/encoding and any locale effects of the CSV file itself are not documented — do a one-row sanity check per terminal build and record the build + broker in your research metadata.
    • Nothing here required access to your terminal, account, or market data; this is documentation-only verification. I can help further, e.g., by writing an MQL5 CopyRates -based exporter that guarantees format stability if you ever want to replace the GUI export

TY so much bro