How to import tick data into MT5
Create a custom symbol, import M1 bars and ticks, then test on real ticks.
If your data is a few hours off your broker's chart, bars are cut differently, and the signals in your backtest change too.
Updated 2026-12-02
For M1 to H1 bars, moving the clock by whole hours only changes the labels. H4, D1 and W1 are different: a new starting point means different prices inside the bar.
Daily bars show it best. Cut at the New York close, a week has exactly five. Cut in UTC, there is also a very short Sunday bar. We tried one week of test data in the same file format: the New York close gave 5 daily bars, and UTC gave 6.
| Region | Starts | Ends |
|---|---|---|
| United States | Second Sunday in March | First Sunday in November |
| European Union | Last Sunday in March | Last Sunday in October |
They don't change on the same day. For two to three weeks in March and about one week in autumn, the gap between the US and Europe is an hour smaller. In those weeks, a server on European daylight saving and one on US daylight saving are an hour apart.
The current US rule began in 2007; before that it ran from April to October. For a long backtest, don't shift times by a fixed number of hours. Use a time zone that knows the rules.
Print((TimeTradeServer() - TimeGMT()) / 3600.0);
In MT4, use TimeCurrent() in place of TimeTradeServer(), while the market is open.
One day is not enough. To tell US from European daylight saving, look at the middle weeks of March and check whether the week still has five daily bars.
When you export, Advanced options has a time zone list: UTC, GMT+2/+3 (New York close), zones with European daylight saving, Tokyo, Hong Kong and more. When you import into MT4 and the client can read the server time from the terminal's history, it selects the zone for you. You can try the zones on the sample on the export formats page.
Convert to New York time, then add 7 hours. The result is GMT+2/+3 server time. The time zone library handles daylight saving for you.
import pandas as pd
ticks = pd.read_csv("EURUSD.csv", parse_dates=["datetime"], index_col="datetime")
ny = ticks.tz_localize("UTC").tz_convert("America/New_York")
server = ny.tz_localize(None)
server.index = server.index + pd.Timedelta(hours=7)
d1 = server["bid"].resample("1D").ohlc().dropna() # five daily bars a weekMore code is in forex tick data in Python.
Guides
Create a custom symbol, import M1 bars and ticks, then test on real ticks.
What .hst and .fxt are, why quality shows n/a, and how to check your data.
How the five tester models differ, what happens to missing ticks, and when to use which.
Download the client and, the first time you open it, click “Try free for 7 days” in the setup guide: no sign-up and no payment. Choose one symbol and download its last 7 days of data; every export format and one-click import are available. Once you're sure it suits you, choose a single symbol or all markets.