Loading...

DDE & RTD Data Exchange

Disclaimer:  The information on this page makes references to commercially available software (Microsoft Excel™ ) for the purposes of educating our clients on the functionality of our software.  Aerarius Indicium does not endorse, or make any recommendations as to the use of, any specific software other than its own PhoenixAI software.

Please note also that although the market symbol BHP is used in the examples on this page, this is for illustration purposes only and should not be taken as advice to buy or sell anything.


DDE (Dynamic Data Exchange) and RTD (Real Time Data) are software functions that enable two concurrent applications to share data from a common source.

Both can be used to import streaming data from PhoenixAI into other software such as an Excel™ spreadsheet.

The list of data types that can be imported from PhoenixAI is as follows:

Data exchange
DDE   RTD
Server name MISDATA   PHOENIXAI.QUOTES
       
Data type
LAST
OPEN
HIGH
LOW
VOLUME
VALUE
TRANSACTIONS
TIMESTAMP
BID


ASK


PREVIOUSCLOSE
MOVE
EQ_PRICE

BID_QTY_SUM_3
ASK_QTY_SUM_3
BID_QTY_SUM_4
ASK_QTY_SUM_4
BID_QTY_SUM_5
ASK_QTY_SUM_5
BID_QTY_SUM_6
ASK_QTY_SUM_6
  LAST
OPEN
HIGH
LOW
VOLUME
VALUE
TRANSACTIONS
TIMESTAMP
BID
BIDFLAG
BIDVOL
ASK
ASKFLAG
ASKVOL
PREVIOUSCLOSE
MOVE
EQ_PRICE
MATCHPRICE
BID_QTY_SUM_3
ASK_QTY_SUM_3
BID_QTY_SUM_4
ASK_QTY_SUM_4
BID_QTY_SUM_5
ASK_QTY_SUM_5
BID_QTY_SUM_6
ASK_QTY_SUM_6
EXDATE
EXPRICE
OPENINTEREST
REPORTFLAG
SURPLUSVOLUME
MARKET_DEPTH
       

As you can see, RTD has several more functions available than DDE.  RTD also offers more flexibility within your spreadsheet program, in that you can use cell references within the formulae instead of the name of the symbol or data type. 

See the spreadsheet examples below. 

In the first example, lines 2 and 3 both show open and last price data for BHP.

  A B C
1   OPEN LAST
2 BHP 45.2 45.54
3 BHP 45.2 45.54

In the second example, however, we can see the formula used for line 3 differs from line 2.

A B C
1   OPEN LAST
2 BHP =RTD("phoenixai.quotes","","OPEN","BHP.ASX") =RTD("phoenixai.quotes","","LAST","BHP.ASX")
3 BHP =RTD("phoenixai.quotes","",A$3,$B1) =RTD("phoenixai.quotes","",A$3,$C1)

The formula in line 2 uses the RTD codes for both the symbol name and the data type.
The formula in line 3 uses cell references to obtain both the symbol name and the data type.

Using cell references allows you to set up calculations based on the symbol name in a given cell, and when you change the symbol in that cell, the spreadcheet calculations respond to the new symbol.

This allows you to quickly build a table of data by copying and pasting formulae.

H
I
N
T
Note the $ in the cell references is a standard spreasheet method of setting an absolute cell reference.
The $ before the column name means stay on this column, but allow the row reference to change.
The $ before the row number means stay on this row, but allow the column reference to change.
If you wanted to absolutely specify both the column and row, you'd use it like this: $A$2

 

Let's take a good look at the formulas for DDE and RTD.  There are differences, and RTD is capable of more functions than DDE.

In this section we'll cover both, and give you lots of examples of how each method works.

To access the server via your own software, the DDE server details are as follows

 

Below is a list of the actual DDE and RTD formulas.

=MISDATA|LAST!BHP.ASX
=MISDATA|OPEN!BHP.ASX
=MISDATA|HIGH!BHP.ASX
=MISDATA|LOW!BHP.ASX
=MISDATA|VOLUME!BHP.ASX
=MISDATA|VALUE!BHP.ASX
=MISDATA|TRANSACTIONS!BHP.ASX
=MISDATA|TIMESTAMP!BHP.ASX
=MISDATA|BID!BHP.ASX


=MISDATA|ASK!BHP.ASX


=MISDATA|PREVIOUSCLOSE!BHP.ASX
=MISDATA|MOVE!BHP.ASX
=MISDATA|EQ_PRICE!BHP.ASX

=MISDATA|BID_QTY_SUM_3!BHP.ASX
=MISDATA|ASK_QTY_SUM_3!BHP.ASX
=MISDATA|BID_QTY_SUM_4!BHP.ASX
=MISDATA|ASK_QTY_SUM_4!BHP.ASX
=MISDATA|BID_QTY_SUM_5!BHP.ASX
=MISDATA|ASK_QTY_SUM_5!BHP.ASX
=MISDATA|BID_QTY_SUM_6!BHP.ASX
=MISDATA|ASK_QTY_SUM_6!BHP.ASX
=RTD("phoenixai.quotes","","LAST","BHP.ASX")
=RTD("phoenixai.quotes","","OPEN","BHP.ASX")
=RTD("phoenixai.quotes","","HIGH","BHP.ASX")
=RTD("phoenixai.quotes","","LOW","BHP.ASX")
=RTD("phoenixai.quotes","","VOLUME","BHP.ASX")
=RTD("phoenixai.quotes","","VALUE","BHP.ASX")
=RTD("phoenixai.quotes","","TRANSACTIONS","BHP.ASX")
=RTD("phoenixai.quotes","","TIMESTAMP","BHP.ASX")
=RTD("phoenixai.quotes","","BID","BHP.ASX")
=RTD("phoenixai.quotes","","BIDFLAG","BHP.ASX")
=RTD("phoenixai.quotes","","BIDVOL","BHP.ASX")
=RTD("phoenixai.quotes","","ASK","BHP.ASX")
=RTD("phoenixai.quotes","","ASKFLAG","BHP.ASX")
=RTD("phoenixai.quotes","","ASKVOL","BHP.ASX")
=RTD("phoenixai.quotes","","PREVIOUSCLOSE","BHP.ASX")
=RTD("phoenixai.quotes","","MOVE","BHP.ASX")
=RTD("phoenixai.quotes","","EQ_PRICE","BHP.ASX")
=RTD("phoenixai.quotes","","MATCHPRICE","BHP.ASX")
=RTD("phoenixai.quotes","","BID_QTY_SUM_3","BHP.ASX")
=RTD("phoenixai.quotes","","ASK_QTY_SUM_3","BHP.ASX")
=RTD("phoenixai.quotes","","BID_QTY_SUM_4","BHP.ASX")
=RTD("phoenixai.quotes","","ASK_QTY_SUM_4","BHP.ASX")
=RTD("phoenixai.quotes","","BID_QTY_SUM_5","BHP.ASX")
=RTD("phoenixai.quotes","","ASK_QTY_SUM_5","BHP.ASX")
=RTD("phoenixai.quotes","","BID_QTY_SUM_6","BHP.ASX")
=RTD("phoenixai.quotes","","ASK_QTY_SUM_6","BHP.ASX")
=RTD("phoenixai.quotes","","EXDATE","BHP.ASX")
=RTD("phoenixai.quotes","","EXPRICE","BHP.ASX")
=RTD("phoenixai.quotes","","OPENINTEREST","BHP.ASX")
=RTD("phoenixai.quotes","","REPORTFLAG","BHP.ASX")
=RTD("phoenixai.quotes","","SURPLUSVOLUME","BHP.ASX")
=RTD("phoenixai.quotes","","MARKET_DEPTH","BHP.ASX")
   

 

 

Depth data via RTD:

This is quite a complex section, so I urge you to read it carefully, and only implement it if you feel confident enough to try.

Using RTD, you can view 10 levels of bid and ask orders for market depth.  This is summary depth only, and can not show individual orders.

DDE does not support the MARKET_DEPTH data type.

 

The RTD code for market depth is:

=RTD("phoenixai.quotes","","MARKET_DEPTH","BHP.ASX")

This code, when entered in Excel, produces information like this:

{45.59,7007,45.6,8740;45.58,14477,45.61,7287;45.57,2075,45.62,1021;45.56,3585,45.63, 2038;45.55,1517,45.64,3515;45.54,5280,45.65,23668;45.53,11000,45.68,8000;45.51,789
,45.69,2686;45.5,6408,45.7,11520;45.48,500,45.71,4724}


Not very useful, is it?  That's because the values are being presented in an array.

We can make it useful by wrapping the RTD request inside a built-in formula in Excel - GETDEPTH.

GETDEPTH takes the information provided by RTD, and places it in an array, which is more easily readable.

=GETDEPTH(RTD("phoenixai.quotes","","MARKET_DEPTH","BHP.ASX"))

When using the GETDEPTH function, place the RTD request inside parentheses ().

We can make this even more useful by including a cell reference instead of specifying a symbol.

=GETDEPTH(RTD("phoenixai.quotes","","MARKET_DEPTH",INDIRECT(ADDRESS(1,2))))

Row,column notation is used to specify the cell reference, and the INDIRECT function is included to ensure that the specified cell is referenced regardless of where the array is placed or moved in the spreadsheet.

INDIRECT is sort of like using the $ to specify an absolute cell reference, but it also has other uses which we're not going into here - Google is your friend.

In this case the cell we're referencing is B1, so if we type "BHP" (without the quotes) into the cell B1, the array would return the first 10 depth levels for BHP.  You can, of course, change the cell reference to suit yourself.

Now, how to go about building an array?

It's actually pretty easy.

First, get the formula you're going to use:

=GETDEPTH(RTD("phoenixai.quotes","","MARKET_DEPTH",INDIRECT(ADDRESS(1,2))))


Change the cell reference to suit yourself (we're going to make it C2 just to be different).

=GETDEPTH(RTD("phoenixai.quotes","","MARKET_DEPTH",INDIRECT(ADDRESS(2,3))))

Then copy the formula (CTRL+C).


In your spreadsheet, go to the cell your formula references (in this case, C2)

Enter the symbol for the array (in this case, bhp)

Now click on the cell where you want to start the array.  This cell will become the top-left corner of a 4x10 grid (4 columns X 10 rows).


We'll start our array on C4.

Click on the cell C4, and drag to cell F14.  This should highlight all cells from C4 to F14.


Press the equals key (=) on the keyboard to start a formula.

Now press the backspace key on the keyboard to delete the = sign (because our copied formula already has an = in it).

Press CTRL+V to paste the formula.

Press CTRL+SHIFT+ENTER to complete the array.

If you just ended up with a value in one cell, try again and check your steps as you go.

If you've done it right, you should end up with something that looks like this:

bhp      
       
45.97
45.96
45.95
45.94
45.93
45.92
45.91
45.9
45.88
45.86
1116
9028
11788
13968
6024
3436
3270
2196
1432
3851
45.98
45.99
46
46.01
46.02
46.03
46.04
46.05
46.06
46.07
3368
11954
99587
12406
6208
2531
2990
1577
627
112


Now you can pretty it up a bit so it's easy to see what's going on, by adding some column headers for "bid" and "ask", etc.

 

BHP
Bids Asks
45.97
45.96
45.95
45.94
45.93
45.92
45.91
45.9
45.88
45.86
1116
9028
11788
13968
6024
3436
3270
2196
1432
3851
45.98
45.99
46
46.01
46.02
46.03
46.04
46.05
46.06
46.07
3368
11954
99587
12406
6208
2531
2990
1577
627
112

 

 

Note that had you used the formula that didn't have a cell reference:

=GETDEPTH(RTD("phoenixai.quotes","","MARKET_DEPTH","BHP.ASX"))

This would still have worked fine.  We used the cell reference example to demonstrate the flexibility of the formula.

 

Server Name - MISDATA

 

Item - Any Symbol, say BHP.ASX or XJO.ASX etc.

Import method for DDE:

Press and hold the CTRL & ALT keys, then click in your watch list on the desired stock code. Hold the left mouse button down until a little label appears above the mouse pointer.

While holding CTRL, ALT and the Mouse down, drag the cell to your spreadsheet application.
Release the mouse button, and select from the pop-up box, which data you would like entered into the cell.

The cells in the spreadsheet will then automatically update from PhoenixAI as the data changes.

Alternatively, you can just enter the formulas directly.

 

 

 

Related Topics:
Watch Lists
Market Depth

Microsoft, Excel and Microsoft Excel are registered trademarks of Microsoft Corporation.

45.97
45.96
45.95
45.94
45.93
45.92
45.91
45.9
45.88
45.86