
For intraday backtests, the differences that actually matter are how MT4 stores per-symbol .hst files versus MT5's M1-based reconstruction and separate tick handling. Import verified M1 bars or real ticks, match your terminal's timezone to your data source, and run a short audit before trusting any result. A ready-to-import set like BacktestMarket's historical data removes most of the guesswork quants otherwise spend hours chasing.
TL;DR:
- Only real tick data can guarantee high intrabar accuracy; synthetic ticks generated from minute bars significantly reduce model quality, especially for high-frequency strategies.
- MT4 stores data in
.hstfiles with a specific CSV format, while MT5 uses a more complex nine-column CSV for custom instruments; improper formatting or duplicated timestamps can silently corrupt backtest results.- Importing data into MT4 requires setting maximum history bars and verifying chronological order before testing, while MT5 demands creating custom symbols and matching timezone offsets for reliable results.
- Using pre-cleaned datasets from BacktestMarket simplifies import workflows, providing correctly formatted files with documented vintage and adjustments, reducing hours of manual reformatting.
- Validating imported data involves checking for correct timestamp order, expected bar count, and consistency with known price spikes, with dedicated tools available for deeper audits of tick and spread accuracy.
Table of Contents
- MT4 vs MT5 Data Formats: What Each Platform Actually Expects
- Why Tick Data Changes Backtest Accuracy More Than Format Does
- How Do You Import and Validate MT4 Trading Data?
- How Do You Import Data Into MT5 Without Losing History?
- What's the Fastest Way to Audit Imported Data?
- How BacktestMarket Datasets Remove the Import Friction
- What Quants Should Prioritize First
- Get Trading Data Ready for MT4 or MT5 Today
- Sources
- FAQ
MT4 vs MT5 Data Formats: What Each Platform Actually Expects
MT4 and MT5 look similar on the surface, but their import pipelines diverge in ways that break files silently if you ignore them. MT4 stores history locally as a per-symbol, per-timeframe .hst file, and its History Center import expects plain CSV with a specific column order. MT5 takes a different route: it treats external data as a custom instrument, and its import dialog wants extra columns MT4 never asks for.
The exact formats:
- MT4 CSV columns:
YYYY.MM.DD,HH:MM,Open,High,Low,Close,Volume, oldest bar first, decimal points (not commas), no header row. This is documented directly in the MetaTrader 4 History Center guide. - MT5 CSV columns:
Date (YYYY.MM.DD), Time (HH:MM), Open, High, Low, Close, TickVolume, Real Volume, Spread, per the MetaTrader 5 custom instruments documentation. Missing Real Volume or Spread columns are typically filled with zero placeholders rather than omitted.
Storage location differs too. MT4's .hst archive lives in the terminal's history folder and is fully overwritten on reimport. MT5 manages history through the Symbols window and custom-instrument database, which is more resistant to accidental overwrites but far less forgiving if you import into a live broker symbol instead of a custom one. Both platforms enforce one bar per timestamp and reject duplicates outright, so deduplicate your CSV before either import.
Why Tick Data Changes Backtest Accuracy More Than Format Does
File format gets you through the import dialog. Tick completeness decides whether the backtest means anything for a strategy trading below H1.
When a symbol's history has minute bars but no tick records, both testers fall back to generating synthetic ticks within each M1 bar for "Every Tick" mode, according to MetaTrader 5's documentation on real and generated ticks. That works fine for swing strategies. It's a liability for anything sensitive to intrabar path, stop order fills, or slippage.
Statistic: MT4's modeling quality score, often cited as needing to approach 99% for intrabar precision, effectively measures how much of the tested period is backed by real ticks rather than synthetic ones. Feed it only minute bars and that number collapses no matter how clean the OHLC data is.
MT5 separates the concern with its "Every tick based on real ticks" mode, which strictly requires broker or imported tick history to be present, per the same MetaTrader 5 tick generation documentation. Without it, MT5 silently drops back to generated ticks.
Practical tradeoffs to weigh:
- Real tick files run 50 to 100 times larger than equivalent M1 data and slow every backtest pass.
- Generated ticks are fast and fine for pre-filtering hundreds of parameter sets.
- Real ticks are the only credible source of truth once you're down to a shortlist, a point research comparing MT4 and MT5 test models backs up with measurable, case-dependent gaps between the two modes.
Run the same window in both modes and compare trade count and drawdown before deployment. A wide gap tells you the strategy is sensitive to microstructure you haven't modeled yet.
How Do You Import and Validate MT4 Trading Data?
MT4's import path is simple, but the order of operations trips up almost everyone the first time.
- Set Max Bars in History and Max Bars in Chart to your target count (or 9999999) in Tools > Options > Charts, before importing. This setting silently trims older bars otherwise.
- Restart the terminal so the new max bars setting takes effect.
- Open History Center (F2), select the symbol and M1 timeframe, and import your CSV using the exact column order from the MetaTrader 4 documentation: comma delimiter, period decimals, no header row.
- Import M1 only. Let MT4 rebuild every higher timeframe from those minute bars rather than importing each timeframe separately.
- Confirm rows are in strictly ascending timestamp order with no duplicates before you import; MT4 rejects out-of-order or repeated bars.
- Validate: check the earliest visible bar matches your file's start date, run a short tester pass, and confirm modeling quality improved once tick data (if any) is layered in.
Pro Tip: Always import into a fresh symbol name the first time. If the import fails partway, you keep your original broker data intact instead of overwriting it with a corrupted mix.
Our guide on importing CSV data into MT4 walks through each dialog screen if you want the visual reference.
How Do You Import Data Into MT5 Without Losing History?
MT5 doesn't let you overwrite a live broker symbol's history directly. Instead, you create a custom symbol and import into that, which changes a few steps versus MT4.
- Open the Symbols window (Ctrl+U), right-click, and choose to create a custom symbol, copying specs from an existing broker symbol as a base template.
- Finalize the symbol's specifications first: tick size, point accuracy, and chart mode. Changing these later can delete existing minute or tick history without warning.
- Open the custom symbol's properties and go to the Bars tab to import your M1 CSV, matching the nine-column format (Date, Time, Open, High, Low, Close, TickVolume, Real Volume, Spread).
- If you have genuine tick-level data, repeat the process in the Ticks tab of the same dialog.
- Correct any hour offset between your data source's timezone and the platform's server time before importing, a step FX Foundations' MT5 import guide flags as one of the most common causes of shifted candles.
- Validate by exporting a sample date range back out and comparing bar counts against your source file, then switch the tester to "Every tick based on real ticks" only once you've confirmed tick history actually exists for that range.
Pro Tip: Export a tiny 500 bar test file first. It takes seconds to import and confirms your column mapping before you commit a multi year dataset to the wrong format.
For the combined MT4 and MT5 workflow side by side, see how to import historical data in MetaTrader 4 and 5.
What's the Fastest Way to Audit Imported Data?
Most bad backtests trace back to one of five preventable mistakes. Catching them takes ten minutes if you know where to look.
- Wrong delimiter or decimal separator: a comma-decimal export from a European data source silently breaks a period-expecting import; reformat before loading.
- Duplicate timestamps: both platforms reject them, but a partial rejection can leave gaps mid-file; scan for duplicates before import, not after.
- Timezone mismatch: a one or two hour offset shows up as candles that look shifted against known news events; align server time to your source explicitly.
- Max bars trimming: MT4 will quietly cut older history if the max bars setting wasn't raised first; always set it before, never after.
- Broker sync overwrites: MT4 and MT5 both can pull fresh data from the broker on connect, replacing your imported file; work offline or on a custom symbol to prevent this.
| Check | What to verify | Fix if it fails |
|---|---|---|
| Timestamp order | Strictly ascending, no gaps beyond weekends | Resort and dedupe the CSV |
| Bar count | Matches expected count for the date range | Re-export the source file |
| Sample trade | A known trade or price spike matches a reference chart | Re-check timezone offset |
| File hash | Recorded at export for reproducibility | Re-download and re-hash |
Escalate to your data vendor if tick history is missing entirely, mismatches persist across more than one broker feed, or spreads look inconsistent with the instrument's typical range. Our MT5 backtesting data audit guide and the MT4 missing data recovery guide both cover deeper fixes for these exact failure modes.
How BacktestMarket Datasets Remove the Import Friction
Every step above assumes you're starting from a raw CSV of uncertain quality. BacktestMarket has supplied clean minute-bar intraday data across forex, metals, bonds, and stock indices since 2014, formatted specifically to drop into the import steps described here rather than needing reformatting first.
That translates into a shorter path from download to a trustworthy backtest:
- Files ship pre-sorted oldest-first with the correct column order for direct History Center import on MT4 or custom-symbol import on MT5.
- Support comes directly from the engineers who build the datasets, which matters when a timezone or spread question needs a real answer, not a ticket queue.
- Documentation accompanying each dataset tracks vintage and adjustments, so you're not guessing what gap-fill or back-adjustment logic was applied.
The practical sequence: download a sample range, import it using the MT4 or MT5 steps above, then run the five-check audit before scaling up to the full history. It's the same workflow described earlier, just starting from a file that's already passed the checks most raw exports fail.
What Quants Should Prioritize First
If you trade below H1, timezone alignment and tick availability decide whether your backtest means anything. Get those two right before optimizing a single parameter. Keep an immutable copy of every dataset with a short passport (source, timezone, export date, file hash) so results stay reproducible months later. And before deploying anything live, run the generated tick versus real tick comparison described earlier. It costs a few minutes and it catches the strategies that only look profitable on synthetic fills.
— Start
Get Trading Data Ready for MT4 or MT5 Today
Reformatting broker exports and chasing missing ticks eats hours you could spend testing strategies instead. BacktestMarket's Historical Data Complete Pack skips that entirely: minute-bar files across forex, metals, bonds, and indices, pre-sorted and column-matched for direct import into MT4's History Center or an MT5 custom symbol.
Start with a sample range from the historical data catalog to confirm the format fits your workflow, then decide whether a one-time pack or the Annual Plan at €119 per year makes more sense for how often you refresh datasets. If you're building automated systems on top of the data, the site's Expert Advisors and Indicators are built to work against the same clean history. Engineers are available directly if an import doesn't behave the way this guide describes, and that's usually a five-minute fix once someone who built the files looks at it.
Sources
- History Center — MetaTrader 4 Help
- Custom financial instruments — MetaTrader 5 Help
- Real and generated ticks — MetaTrader 5 Help
- MT5 data import guide — FX Foundations
- Mql5
FAQ
Can I Convert MT4 .hst Files Directly Into MT5 Format?
Not directly. You need to export the underlying price data to CSV first, then reformat the columns to match MT5's nine-field structure before importing into a custom symbol.
Why Did My MT4 Import Delete Older History?
Almost always the Max Bars in History setting was left at its default and quietly trimmed the file. Raise that limit and restart the terminal before reimporting.
Does BacktestMarket's Data Include Real Tick History?
BacktestMarket focuses on clean minute-bar data across asset classes, formatted for direct MT4 and MT5 import; specific tick-level coverage details are listed on the historical data page for each instrument.
How Do I Know if My Backtest Used Generated or Real Ticks?
Check the modeling quality report after a test run. A score well below the typical near-99% benchmark for real-tick coverage usually means the tester filled gaps with generated ticks instead of actual broker data.
Should I Automate Data Imports for Live Strategy Updates?
Yes, for ongoing systems, but only after your first manual import passes every audit check. Automating a broken pipeline just repeats the same timezone or duplicate-timestamp error on every refresh.
Recommended
- Audit First MT5 Backtesting Data: Gap, Timestamp, Ready to Import
- How to Achieve 99% Modeling Quality in MT4 for Backtests
- How to Fix the MT4 GMT Offset for Accurate EA Timing
- Fixing MT4 Missing Data: A Complete Recovery Guide
Related resources
Explore BacktestMarket's how to import data into MetaTrader to put the ideas in this article into practice.


