Export Live Data from MT4 to Excel

by Sep 30, 2022Forex Trading Platform

Ultimate Tutorial for Traders

This tutorial have all what is needed about trading. It includes step by step guide:

How to start trading

What are trading basics every trader must know

Risk Management

Foundation strategy with supply and demand

 

You can export live data from MT4 to excel by enabling DDE server inside MT4 and connect MT4 with excel where you get live price quotes into excel file.

It is a simple process where you get an excel file with the data filled automatically. The data you get you can easily use in your favor in Excel file and make analysis.

You can use excel file to make necessary filters by filtering symbols, bid, ask, high and low price of a candle.

Read more: Bid and Ask Price on MT4

Export Live Data From MT4 to Excel

With exporting live data from MT4 to Excel you get a live feed of quotes inside excel file which you can use to analyze.

Excel gives you a lot of possible tools you can use to combine and analyze the data you get from the MT4.

The data you get from the MT4, low, high, bid and ask is a feed that changes on each tick, but you can make a combination of that data to get valuable insight about the currency pair.

How Do I Connect MT4 to Excel?

There are few steps you need to take to export live data from MT4 to excel. Use MT4 and activate DDE server and then open DDE-Sample Excel file.

DDE is Dynamic Data Exchange protocol of Microsoft Windows used to dynamically exchange data between applications.

Here are few notes you need to remember when using DDE server and Excel file:

  • you get price quote of a certain symbol only on a new tick
    • you cannot get new data if you send a request to MT4
  • first quote you will get when starting the Excel file is N/A, but second quote will be from the chart
  • data from MT4 is received inside excel file only if MT4 is Online
  • history data inside MT4 cannot be retrieved to Excel over DDE protocol

Read more: MT4 Account History

Let’s go through each step so you can do it yourself and get MT4 data inside an Excel file.

Metatrader 4 DDE Server

First step is to go to MT4 and in the menu section select Tools -> Options.

Tools and option to enable DDE server

Now, in the Server tab check the box next to “Enable DDE server”. Click OK and move to the next step to open Excel file.

Enable DDE server in MT4

Open DDE-Sample Excel File

When you are inside MT4 go to File -> Open Data Folder to find a DDE-Sample Excel file you can use.

File Open Data Folder

The folder that should open is located inside the Program Files or Program Files (x86) folder inside MS Windows.

If you do not open the Program Files folder then manually go to the location inside your PC and locate the Metatrader 4 installation folder.

Read more: How to Install MT4 on PC

Inside that folder you will see DDE-Sample Excel files read to be used. Click on it and open the Excel file.

Program Files MT4 Folder

Next you will receive a second message saying that you have external resources that could be unsafe.

Click the Update button and continue using the DDE-Sample excel file.

Read more: Update MT4 Manually

DDE Sample Excel File

The DDE-Sample excel file contains four rows with four currency symbols you can use immediately. The DDE data exchange is prepared and if you have MT4 open it should start to receive data right away.

When you start the Excel file you will see a warning message about using DDE protocol data exchange. Simply click the OK buttton.

DDE Sample Excel Safety Message

Excel File With MT4 Live Data

When you compare the data when you start a DDE-Sample Excel file and when data starts to come from the MT4 platform you will see a difference.

I have put an excel file without data at the beginning and then an excel file with the data from MT4. Next to that image I have put the MT4 platform so you can see how the data inside the Excel file received the same information that is inside MT4.

You can see that the price of the currency symbol is transferred to the excel file.

DDE MT4 Exchange Difference

With the data inside the Excel file you can start using them as you wish.

MT4 DDE Excel Commands

The Excel file is populated with the data from MT4 using DDE Excel commands. There are limited number of commands you can use to export live data from MT4 to Excel.

Here are commands you can use:

  • BID request: = @MT4|BID!USDCHF
  • ASK request: = @MT4|ASK!USDCHF
  • HIGH request: = @MT4|HIGH!USDCHF
  • LOW request: = @MT4|LOW!USDCHF
  • TIME request in seconds: = @MT4|TIMESEC!USDCHF
  • TIME request: = @MT4|TIME!USDCHF
  • QUOTE request: = @MT4|QUOTE!USDCHF

If you think to get Open and Close of a candle that will not be possible. Because there is no DDE Command inside Excel to get those values.

DDE Command inside Excel

If you position yourself in the Excel field you will see which command is used to retrieve data from MT4.

Request Time in Minutes

If you open an Excel file and there is no column with the Time in minutes and only in seconds you can add that column yourself.

Simply go to the last column, in this case the last column is I column, after H column, and enter this command in the excel field for the currency symbol you want:

TIME request: = @MT4|TIME!USDCHF

You will immediately receive the time data for that currency symbol.

DDE command for time in minutes

But, you will see some numbers which are not time if you do not format the excel field to be time.

In my case you can see that I have an odd number so I will format the field to be as a number.

To do that select the column, in this case it is column I, and click the right mouse button and select “Format Cells“.

In a new menu select the “Number” tab and in the possible options select “Time” under “Category“.

In the Time options select the time format you want to use. I have used 13:30:555 which is hh:mm:ss time format.

Format Column into Time

After you format the column you will see the time of a currency symbol in minutes without seconds.

MT4 data time in minutes

Why Export MetaTrader Prices to Excel?

Inside excel there are various tools you can use to analyze the quotes from MT4:

  • charts
  • formulas
  • comparison

With these tools you can make combinations and analyze the data more readable to you than simply watching raw data inside MT4.

Export MetaTrader Prices to Excel Without Broker?

If you do not want to use a broker you can use free Metaquotes MT4 to get quotes from MT4.

That way you do not need a broker to export the data from MT4, but you simply open a demo account and get the MT4 data.

Read more: Open Demo Account Without Broker

Create DDE Excel

There is an option to create your own DDE excel if you cannot find one inside the MT4 folder.

The process is simple and here is what you need to do:

  • open new empty Excel file
  • Save it where you want to have it
  • Copy DDE commands inside excel file from below

In DDE-Sample excel file you have these commands:

  • BID request: = @MT4|BID!USDCHF
  • ASK request: = @MT4|ASK!USDCHF
  • HIGH request: = @MT4|HIGH!USDCHF
  • LOW request: = @MT4|LOW!USDCHF
  • TIME request in seconds: = @MT4|TIMESEC!USDCHF
  • TIME request: = @MT4|TIME!USDCHF
  • QUOTE request: = @MT4|QUOTE!USDCHF

To copy commands to new excel file you need to add ‘ (apostrophe) before and after MT4 inside command to look like this:

  • BID request: = @MT4|BID!USDCHF

So the difference between two commands in the DDE-Sample file is this:

  • = @MT4|BID!USDCHF
  • = @MT4|BID!USDCHF
Create DDE Excel file

Download PDFs for Trading

A download section is a place where you can download PDFs/indicators, MT4 and more, that will help you in trading.

“Disclosure: Some of the links in this post are “affiliate links.” This means if you click on the link and purchase the item, I will receive an affiliate commission. This does not cost you anything extra on the usual cost of the product, and may sometimes cost less as I have some affiliate discounts in place I can offer you”

Frano Grgić

Frano Grgić

A Forex trader since 2009. I like to share my knowledge and I like to analyze the markets. My goal is to have a website which will be the first choice for traders and beginners. Market analysis is featured by Forex Factory next to large publications like DailyFX, Bloomberg... GetKnowTrading is becoming recognized among traders as a website with simple and effective market analysis.

Ultimate Tutorial for Traders

This tutorial have all what is needed about trading. It includes step by step guide:

How to start trading

What are trading basics every trader must know

Risk Management

Foundation strategy with supply and demand

 

Forex Trading Platform Articles

Below you can find all articles about Forex trading platform

1. Trading Platform for Beginners

0 Comments

Pin It on Pinterest

Shares
Share This