Export MT4 Data to Excel: DDE, CSV and What Each Misses

Search for how to move MT4 data into Excel and almost every answer describes the same procedure: switch on the DDE server, paste a formula, watch a price update. It works. What the procedure does not tell you is which data it will never reach, and that is the part that decides whether it is the right route at all.

There are two ways out of the platform and a third that neither guide mentions, and they answer different questions. This page separates them, with every limit taken from the MetaQuotes documentation rather than from another tutorial.

Key takeaways

  • Two routes exist and they answer different questions. The DDE link streams current quotes into a live sheet; the History Center writes past bars to a file that never changes again.
  • The documentation states plainly that historical data cannot travel over DDE and that the link only feeds a sheet while the terminal is connected.
  • The DDE fields are bid, ask, high, low and time. There is no open, no close and no volume, so a candle cannot be rebuilt from the live link.
  • Neither route carries your trades. Trade records leave the platform through the account report or through a program writing a file, and MQL file writing is confined to two folders.
  • The vendor documents an Excel-side setting that the request needs, so a formula that returns nothing may be failing in the spreadsheet rather than in the platform.

The Two Routes, and Which Question Each One Answers

The first decision is not which steps to follow. It is whether the sheet needs to keep changing. A live link updates a cell as prices arrive and holds nothing once the connection drops. A file export writes what already happened and then stops, which is what a spreadsheet of past bars needs to be.

Guides collapse the two because the live link is the more impressive demonstration. A trader who wants to study last month at the four-hour timeframe gets the demonstration, follows it, and ends up with a cell showing one moving number. Nothing failed. The wrong route was taken. The split runs along the same line that separates the two platforms elsewhere, compared in MT4 against MT5.

RouteAnswers the questionWhat lands in the sheetStops working when
DDE linkWhat is the price nowA handful of quote fields that overwrite themselvesThe terminal goes offline or closes
History Center exportWhat did this symbol doOne row per bar, with date, time and the four pricesNever; the file is finished when it is written
A program writing a fileWhat did my account do, trade by tradeWhatever the program is written to recordThe program stops running, or writes outside its permitted folders

The Live Link: What DDE Actually Sends

DDE is a Windows mechanism for passing data between running applications, and the terminal ships with it switched off. Turning it on is one checkbox in the terminal settings, and until it is ticked no formula in any spreadsheet will return anything.

The behaviour that generates most of the questions is documented and is not a fault. Quotes travel only when a new tick arrives, not at the moment a cell asks for them. The first request therefore returns nothing usable, and the value appears when the next price does. On a quiet symbol, or outside market hours, a correctly built sheet can sit blank for a long time and still be correctly built.

The formula names the application, the field and the symbol, and the symbol has to match the name the broker uses, suffixes included.

That is the second common cause of an empty cell: a sheet built for a plain pair name against an account whose symbols carry a suffix. The same discipline applies to any data you intend to reuse later, including anything feeding backtesting a strategy, where a mismatched symbol quietly produces a different instrument.

What the Live Link Never Carries

Five quote fields are available through the link, plus two combined forms of the timestamp: bid, ask, high, low and the time. That list is the whole of it, and what it omits matters more than what it contains.

There is no open and no close. A candle has four prices and the live link supplies two of them, so an open-high-low-close row cannot be assembled from it at any timeframe. There is no volume either. A trader who wants candles is on the wrong route, and no formula added to the sheet changes that.

The list is also closed. The timestamp is offered in two precisions and there is a combined request that returns time and prices together, but nothing extends the set beyond those quote fields. A spreadsheet cannot ask the link for something it was not built to send, which is why the workarounds circulating in forums are all attempts to reconstruct missing values from the ones that do arrive.

The larger limit is stated outright in the documentation: past data does not travel over this protocol at all. The link is a window onto the current tick and has no memory. Anything already in the past has to come out through the file route below.

The third limit is the connection. Quotes leave the terminal only while it is online, so a sheet left open overnight holds the last value that arrived and gives no sign that it has stopped being current. A cell that has not moved since yesterday looks identical to a cell on a quiet market.

The File Route: Exporting History as a Text File

Past bars leave through the History Center, which is a separate window rather than a menu item on a chart. It opens from the Tools menu, or with a single key if you work that way, and it lists the symbols the terminal holds data for alongside every timeframe stored for each one.

Selecting a symbol and a timeframe and pressing Export writes the data to disk. Three formats are offered, of which the comma-separated one is what a spreadsheet expects. The file that lands carries one row per bar, and each row holds a date, a time, the open, the high, the low, the close and a volume figure. That is the full candle the live link cannot assemble, and it is why the two routes are not alternatives for the same job.

The key that opens this window is one of the differences between the platforms worth knowing, along with the rest of the keyboard shortcuts.

Two cautions belong with the export, both from the documentation and neither obvious. Data pulled from the historical data server can differ from what the broker’s own trade server holds, so a file exported after a download is not automatically the broker’s version of history.

And the number of bars kept is capped by a setting, with the oldest deleted first once the cap is reached, which means an export can be shorter than the chart suggests for a reason that has nothing to do with the export itself.

The timestamps deserve a second look before the file reaches a spreadsheet. Downloaded history is recalculated to the time zone the account runs on, so the times in the file describe the broker’s clock rather than yours. A sheet that aligns those rows against local events, or against a file exported from a second account on a different server, is comparing two different clocks without saying so.

The same window also works in the other direction, accepting several text formats back into the terminal with controls for the separator, for columns and rows to skip, and for shifting the data in time. That matters here for one reason: a file edited in a spreadsheet can be returned to the platform, so the export is not necessarily the end of the trip.

Getting Trade Records Out, Which Neither Route Does

Both routes carry prices. Neither carries a single thing your account did. The live link does not know about trades and the History Center holds symbol history, so a trader trying to build a spreadsheet of their own results is using tools that were never pointed at that data.

The route most people want here is the platform report, which lists closed operations with their costs and can be saved and opened in a spreadsheet. What each of its columns actually means, and where the profit column misleads, is the subject of the MetaTrader account statement, and this page hands that half over rather than repeating it.

The other route is a program. An expert advisor or a script can write its own file as it runs, which is the only way to record something the report does not contain, such as the state of an indicator at the moment an order went out.

It comes with a constraint worth knowing before anyone plans around it: file operations in MQL are confined to a sandbox of two locations, the files folder inside the terminal data directory and a shared folder common to every terminal on the machine. A program cannot write to the desktop, and a spreadsheet has to be pointed at one of those two places instead. Both of those sit inside the MT4 data folder, which is the half of an installation that has to be carried across by hand when the terminal changes machines.

When the Failure Is in Excel and Not in MT4

A formula that returns nothing sends most people back to the terminal to check the DDE setting a second time. The documentation names a spreadsheet-side option that the request depends on, sitting in the Excel options under the translation of formula entry, and a sheet with that option off behaves exactly like a terminal with the server disabled.

Two more spreadsheet behaviours produce the same symptom. A file that arrives from outside opens in a protected mode that suspends live connections until the file is explicitly trusted, and links to external applications sit behind a prompt that has to be accepted before anything updates. In each case the terminal is doing its job and the sheet is refusing the delivery.

The way to tell the two sides apart is to change one thing at a time. If a second, freshly created sheet in the same session shows the value, the problem belonged to the first file. If neither shows it, the terminal side is worth checking, starting with whether a price has arrived at all since the sheet was opened.

A Checklist Before You Blame the Platform

Work through these in order, because each one rules out a whole class of cause.

Decide first which question you are asking, because a live price and a month of bars come out by different routes and no amount of adjustment converts one into the other. Confirm the DDE server is enabled in the terminal settings if the answer is a live price. Check that the symbol in the formula matches the symbol in the Market Watch exactly, suffix included.

Wait for a tick before concluding anything, since a request made before the next price arrives returns nothing by design. Then move to the spreadsheet: confirm the formula-entry translation option, that the file is trusted rather than sitting in protected view, and that any prompt about external links has been accepted. Only when all of those hold is the terminal the remaining suspect.

If you reached this page because a robot was supposed to be writing the file and nothing appeared, the answer is in a different place again: the platform records what each program did and what it failed to do, and the platform logs will name the error the sheet cannot. That is the first place to look before rebuilding anything.

Sources checked 13 August 2026. MetaQuotes, MetaTrader 4 Help, Export of Quotes. MetaQuotes, MetaTrader 4 Help, History Center. MetaQuotes, MQL5 Reference, File Functions. MetaQuotes, MQL5 Reference, FileOpen.

Disclaimer: This page explains how data moves between a trading platform and a spreadsheet, for educational purposes. It is not investment advice and not a recommendation to trade any instrument or to use any tool. Trading leveraged products carries a high risk of losing money rapidly.

Leave A Reply

Your email address will not be published.