• Script
  • MetaTrader 5
  • Free

History Bridge

MetaTrader 4 only downloads the history your broker keeps on its MT4 server, often just a few months. History Bridge takes the history MetaTrader 5 already has and writes it in the formats MetaTrader 4 reads (.hst and CSV), from M1 to MN1, and checks that every timeframe is complete. For MetaTrader 5.

History Bridge: the full MetaTrader 5 history for MetaTrader 4 backtests
History Bridge: the full MetaTrader 5 history for MetaTrader 4 backtests
Exporting SP500: the card shows the timeframe, the month and the progress
Exporting SP500: the card shows the timeframe, the month and the progress
SP500 finished: 18 files and 3,635,365 bars since 2019, with all nine timeframes OK
SP500 finished: 18 files and 3,635,365 bars since 2019, with all nine timeframes OK
GDAXI finished: 3,269,306 bars since 2018, with all nine timeframes OK
GDAXI finished: 3,269,306 bars since 2018, with all nine timeframes OK

Screenshots taken on a demo account.

What it does

What it exports

  • MetaTrader 4 history files (.hst), ready to copy to the MT4 history folder
  • CSV files for the MT4 History Center, Excel, Python or your own tools
  • Nine timeframes: M1, M5, M15, M30, H1, H4, D1, W1 and MN1
  • The chart symbol or a list of up to 30 symbols, with a different MT4 name when needed (GDAXI=DE40 creates DE401.hst, DE4060.hst…)
  • By default, all the history the server has up to today; or the date range you choose

Checks the data

  • Warns when the MetaTrader 5 “Max bars in chart” limit is cutting the history
  • Status of every timeframe: OK, “Starts yyyy.mm” if it starts later than the server history, “Max bars limit”, “No data” or “Not found”
  • Exports in chunks and retries while MetaTrader 5 downloads the history from the server

Progress card

  • Progress bar and a table with bars, first and last date and status, per timeframe or per symbol
  • At the end the bar turns green if everything is complete, amber if something needs checking and red if a symbol had no data
  • Stop button, which halts the export and deletes unfinished files; Close removes the card and leaves nothing on the chart
  • Automatic light and dark theme, English and Spanish

Requirements

  • MetaTrader 5 with the symbol’s history; for long M1 histories, “Max bars in chart” set to Unlimited
  • MetaTrader 4 build 600 or later to use the files
  • Files are created in MQL5\Files\HistoryBridge: Market programs can only write there, so you copy them to MT4 by hand (with MT4 closed)
  • Disk space: eight years of M1 are about 3 million bars, around 180 MB as .hst and a similar size as CSV

Main inputs

SymbolsEmpty exports the chart symbol. Otherwise, a comma-separated list; NAME=MT4NAME changes the name used for MT4. Up to 30 symbols.
Export from / Export toFirst and last date. 1970.01.01 means all the server history and up to now. Start a few months before your backtest so indicators have previous bars.
M1 … MN1Timeframes to export. For an MT4 backtest, at least M1 and your EA’s timeframe.
Files to create.hst and CSV, .hst only or CSV only.
Subfolder inside MQL5\FilesFolder for the files (HistoryBridge). Empty writes directly in MQL5\Files.
CSV separator / date format / header lineCSV format. For the MT4 History Center, keep the defaults: comma, MT4 date format and no header.
Language / Panel themeCard language (English or Spanish) and theme: automatic, dark or light.

History Bridge only reads the MetaTrader 5 price history and writes files: it does not open, close or modify trades or give signals. A backtest is only as good as its history, but results on historical data do not guarantee future results.

How to install it

  1. 1

    Open the Market tab in MetaTrader 5

    Sign in with your MQL5 account.

  2. 2

    Find History Bridge and install it

    It will appear in the MetaTrader Navigator, under Scripts → Market.

  3. 3

    Drag it onto a chart of the symbol

    First, set “Max bars in chart” to Unlimited (Tools → Options → Charts) and restart MetaTrader 5. Then keep the inputs as they are or choose symbols and dates, and press OK.

    Open the user guide →

Questions

Does it work on MetaTrader 4?

It runs on MetaTrader 5, and the files it creates are for MetaTrader 4: you copy them to its history folder or import them in the History Center.

Does it open trades for me?

No. It only reads the MetaTrader 5 price history and writes files; it gives no signals.

Where is the user guide?

Here, on this website: Open the user guide.

Does it cost anything?

No, it is free: download it from the Market and run it on a MetaTrader 5 chart.

Is it safe for my account?

It never sends, modifies or closes orders: it only reads price history and writes files in the MQL5\Files folder.

Why can it not copy the files to MetaTrader 4 by itself?

MetaTrader 5 Market programs can only write inside MQL5\Files. Copying them takes a minute: close MT4, paste them into history\<your server> and run the backtest with MT4 offline, so the server does not replace them.

M1 starts much later than H1. Why?

“Max bars in chart” is limited in MetaTrader 5 or the history was not fully downloaded. Set it to Unlimited, restart MT5, open an M1 chart of the symbol, press Home until you reach the start date and run History Bridge again.

Can I use the files with an MT4 account of another broker?

Yes, if both brokers use the same server time and price for the symbol. If not, the backtest will use the MT5 broker’s times and prices.

Does it work in the Strategy Tester?

No. It is a script you run on a chart; the files it creates are for the MetaTrader 4 tester.

History Bridge

Download it free on the MQL5 Market

FreeComing soon to MQL5

More from Jasopex

49 USDIndicator

Zone Risk Planner

Support and resistance zones turned into a plan with entry, stop, take profit and lot size, plus your whole account’s risk at a glance.

The free version of Zone Risk Planner: support and resistance zones and a plan with entry, stop, take profit and lot size.

A panel that tells you whether the market is moving a lot or a little for that asset, with an ATR-based trailing stop.