Universal DDE

DDE (Dynamic Data Exchange) is an old Windows protocol used in the past for exchanging data between applications. Nowadays it is obsolete. However, several trading platforms (especially those that have been on the market for a long time like Metatrader) use this protocol to send Real-Time (and ONLY real-time) data to other applications. DDE cannot be used to receive historical data.

Data transmitted via DDE is very approximate and unsuitable for any professional analysis. Unless you have special needs, DO NOT connect Overcharts to other applications via DDE.

General Information #

DDE protocol uses particular connection strings (in the format =SERVER|TOPIC!ITEM) which uniquely identify the data to be received from the external application. In trading platforms, the data to be received are generally: date, time, last, bid, ask and related sizes.

The connection string of each single data has the format =SERVER|TOPIC!ITEM where:

  • SERVER indicates DDE service name to connect to
  • TOPIC and ITEM define the data to be received.

Example:

In the Metatrader 4 platform, BID price connection-string of EURUSD (euro/dollar instrument) is: =MT4|BID!EURUSD where MT4 represents the Server, BID the Topic, and EURUSD the Item.

As you can see, instrument symbol (EURUSD) is included in the connection string. In this case, in the DDE connection configuration in Overcharts, we will replace the instrument symbol with the string: $$$. This allows you to make the connection configuration general. The alternative (do not even consider it!) is to configure a DDE connection for each individual instrument.

In our example, BID price connection-string will be: =MT4|BID!$$$

The preconfigured connection to Metatrader 4 is already present in Overcharts.

In general, connection string components are different from application to application. Refer to the documentation of the application you want to connect or ask their support directly). We do not know the other applications in detail and cannot help you with that.

Connection Configuration #

Before continuing, if you are new to the DDE protocol, we recommend that you search for some detailed information on the Internet.

To connect Overcharts to an external application via DDE, follow these steps:

1. Make sure the external application uses the DDE protocol to export real-time data. If the service is supported, you usually need to activate it. Refer to the documentation of the application you want to connect or ask their support directly). We do not know the other applications in detail and cannot help you with that.

2. If DDE protocol is supported, create a new Universal DDE connection from ‘Connections‘ tab of the Overcharts main window.

3. Set the following properties:

DATE & TIME

Date: (optional) set this property with its connection string ONLY if the DDE service you are connecting provides current date and ONLY if the date is provided separately from the time. Then select the right date format from those available. If you do not find the right format among those available, select OTHER and manually define the relative formatting string.

Time (optional): set this property with its connection string ONLY if the DDE service you are connecting provides current time and ONLY if the time is provided separately from the date. Then select the right time format from those available. If you do not find the right format among those available, select OTHER and manually define the relative formatting string.

Date/Time (in the same field): (optional) set this property with its connection string ONLY if the DDE service you are connecting provides current date/time in a single field (in this case, the previous Date and Time properties should NOT be set). Then select the right date/time format from those available. If you do not find the right format among those available, select OTHER and manually define the relative formatting string.

If the date/time is NOT provided by DDE service, do not set the above properties. Current date/time will be the PC date/time.

TRADE

Last (price): define the LAST price connection-string. If the DDE service you are connecting does NOT provide this data, then set this property with Bid or Ask price connection-string.

Last Size (volume): (optional) define the last-filled-quantity connection-string. If the DDE service you are connecting does NOT provide this information, leave it blank.

BID

Bid: (optional) define the current BID-price connection-string. If the DDE service you are connecting does NOT provide this information, leave it blank.

Bid Size (volume): (optional) define the BID-size connection-string. If the DDE service you are connecting does NOT provide this information, leave it blank.

ASK

Ask: (optional) define the current ASK-price connection-string. If the DDE service you are connecting does NOT provide this information, leave it blank.

Ask Size (volume): (optional) define the ASK-size connection-string. If the DDE service you are connecting does NOT provide this information, leave it blank.

FORMAT

Decimal Separator: define the character used as decimal separator (usually ‘.’)

Thousands Separator: define the character used as thousands separator (it is usually not used > in this case leave it blank)

Price Multiplier: necessary only if prices are expressed without decimal separator (e.g. 1055 actually represents 10.55)

Volume Multiplier: necessary only if volumes are expressed without decimal separator (e.g. 1055 actually represents 10.55)

INSTRUMENT

Simulation Account (default): select the default simulation-account for the connection.

QUOTES ADJUSTMENT

Data Time Zone: define the time zone ONLY if it is unique for all the instruments (therefore also if the date/time is NOT provided via DDE, but is the PC date), otherwise leave the default setting: ‘as specified in Exchange/Instrument configuration‘. You will then need to define the right time zone in the exchange/instrument configuration.

Decimal Part expressed as…: define the format of price decimal part (default: decimal).

4. Complete any other required fields.

5. Save.

6. Start the connection from Connections Tab by pressing CONNECT button or by double-clicking on the connection. If a red dot appears in the Real-Time column next to the connection, it means that connection settings are not correct. Hover over “i” icon (next to the red dot) to read a more detailed error message.

Unfortunately, a DDE connection can appear as connected (green dot) even when it actually is not. A green dot is NOT sufficient to indicate whether or not you are connected to the DDE service. It is always necessary to verify you are receiving real-time data by opening a chart. Also remember to start the DDE application and/or service.

Date/Time Formats #

For date/time properties it is also necessary to define the date/time format by selecting the right format among the predefined ones. If desired formatting is not present, choose Other item and define the formatting according to these rules:

Date characters: y = year; m = month; d = day

Time characters: h = hour; m = minute; s = second; f = millisecond; c = microsecond; @pm = post meridiem (to use only if the time is expressed in 12 hours)

Wildcard character: if any date/time part is of variable length, insert a wildcard * (asterisk) before character representing the year, month, day, hour, minute, etc. If it is of fixed length, repeat the character as many times as the part is long. For example, if the year is always expressed as 4 digits, correct format for the year is: yyyy

Separators: Space – / . : etc.

Formatting samples:

20220614yyyymmdd
06 Feb 22dd mmm yy
2022-1-27yyyy-*m-dd
22-01-27*y-*m-*d
17:25:13.000hh:mm:ss.fff
17:25:13.000*h:*m:*s.*f
5:25:13pm*h:mm:ss@pm
16-02-2014 14:30:13.332dd-mm-yyyy hh:mm:ss.fff
16-02-2014 14:30:13.332.547dd-mm-yyyy hh:mm:ss.fff.ccc
11:30hh:mm
11:30:23hh:mm:ss