9 DYNAMIC DATA EXCHANGE (DDE)                  Main Table of Contents

Programs that Can Utilize DDE

Creating a DDE Link in Microsoft® Excel

Create a Real-Time Quote Link

Create a Historical Link

Option

Formula

Creating a Link in Aspen Graphics

Creating a Symbol using DDE

Exporting historical data from MS Excel

Using the AspenTick Function

 

 

 

 

 

 

    Dynamic Data Exchange (DDE) allows information from Aspen to be transferred directly to a spreadsheet program. The links between Aspen and the spreadsheet are live. As information comes into the Aspen program or as Aspen calculates a value, it is immediately updated in the spreadsheet.

    Links can contain quote information, historical data arrays, special option quote fields, and the outputs of Aspen formulas.

Programs that Can Utilize DDE                           Top of Page

      MicrosoftÒ Excel is the only spreadsheet program that we currently recommend with regards to DDE, although customers have successfully used DDE with other programs such as Lotus 1-2-3.

Creating a DDE Link in MicrosoftÒ Excel

      You can create a DDE link from within either Aspen Graphics or Excel. Aspen Graphics must be running for the link to be created. In the following examples, we will create the four different types of links from within the Excel program.

If you create the DDE link from within Excel, your link will automatically be pasted into the highlighted cell(s), so make sure you have selected the appropriate cells before you create the link. You only need to select the cell where you want the link to begin.

Create a Real-Time Quote Link                           Top of Page

To create a real-time quote link, follow these steps:

    1. A single-left click on the first (left-most) of the custom Aspen buttons on the Excel toolbar will display the DDE Link Generator Helper Dialog Box (see Figure 1).

If the toolbar is not displayed, call Aspen Graphics Technical Support for assistance.

Figure 1

    1. Type the symbol to be linked to the spreadsheet in the Symbol field.
    2. DO NOT HIT ENTER!

    3. Select the quote elements you want in the link from the list in the middle of the menu. A single left click displays a description of your selection in the Element Description box. A double left click sends the element to the Selected box (a double-left click on an element in the Selected box puts it back in the original list).
      The elements you select will be displayed in Excel in the order chosen, from left to right, as an indivisible array. You won't be able switch the fields around once they are pasted into Excel, so carefully plan how you will want to view the link.
    1. Select the Copy Link button in the lower right-hand corner. The link will be pasted into the specified cell(s) in Excel.

Create a Historical Link                           Top of Page

To create a link, using historical data, follow these steps:

    1. Select the cell on the spreadsheet where you want the link to begin.
    2. Single-left click on the first DDE button from the toolbar.
    3. A single-left click on the History tab will display the following Link Generator Helper Screen (see Figure 2).

 

Figure 2

    1. In the symbol field, type in the symbol to be linked to the spreadsheet.
    2. Under Interval, select the time base for the historical data to be exported. If you select Intraday, specify the number of minutes per bar in the Span field. For example, if you would like to export 15-minute data, enter 15 in the Span field.
    3. The middle section is where the time span of the historical link is defined. If you do not enter a value in any of these fields, the link pasted will contain 30 periods beginning with the most recent period.

 

Start Date and End Date

          The Start Date defines the earliest data for your link. The End Date defines the most recent data in the link. Start and End Dates must be entered in MM/DD/YY format. For example, to enter the start date of March 1, 1997, type in 3/1/97.

Start Time and End Time                           Top of Page

          If you selected an Intraday interval, a Start Time and End Time can also be entered. Times must be entered in HH:MM format, using 24-hour syntax. For example, if you wanted to enter an end time of 1:00 p.m., you would enter 13:00 in the End Time field.

Max Days

          The Max Days field allows you to limit the number of days in the link if you selected a Daily interval. For example, if you would like to link the last 20 days of data, you would enter 20 in the Max Days field.

Periods                           Top of Page

The Periods field allows you to limit the total number of periods, regardless of the type of interval selected. If you want to link 100 15-minute periods to the spreadsheet, enter the number 100 in the Periods field.

If you do not want to specify either Max Days or Periods for the link, enter a 0 in both fields. Leaving these fields blank will return an error message.
    1. Select the quote elements for the link. By default, all the quote elements are selected for you; deselect any unwanted elements with a single-left click.
    2. Select the Copy Link button in the lower-right-hand corner. The link will now be pasted in the cell(s) you selected.
If the data array you want to paste into Excel contains more than 30 periods, paste your link, then highlight all the cells needed (for example, if you have 50 periods in your link, you need to select cells 1-50). Tap the F2 key one time, hold down the btnctrl.gif (1396 bytes)btnshift.gif (1423 bytes) keys, and tap the btnEnter.gif (1425 bytes) key one time.

Option                           Top of Page

A single left click on the Option tab will display the following Link Generator Helper Box (see figure 3).

Figure 3

The Option Link Generator window looks identical to Quotes, but has fields pertaining specifically to options analysis.

To create an Option Quote Link, follow these steps:

    1. Type the symbol to be linked to the spreadsheet in the Symbol field.
      DO NOT HIT ENTER!
    2. Select the quote elements you want in the link from the list in the middle of the menu. A single left click displays a description of your selection in the Element Description box. A double left click sends the element to the Selected box (a double-left click on an element in the Selected box puts it back in the original list).
      The elements you select will be displayed in Excel in the order chosen, from left to right, as an indivisible array. You won't be able switch the fields around once they are pasted into Excel, so carefully plan how you will want to view the link.
    3. Select the Copy Link button in the lower right-hand corner. The link will be pasted into the specified cell(s) in Excel.

Formula                           Top of Page

Any Aspen Graphics formula or function can be linked to a spreadsheet. To link to a spreadsheet, follow these steps:

    1. Single-left click on the Formula tab.
    2. Enter the name of the formula and the symbol(s) to be used in the formula.

Example: IntrVal(sph7)

Aspen exports the output or the value of the formula to Excel; it does not export the formula itself.
    1. Select the Copy Link button in the lower-right-hand corner. The output of the formula will be pasted in the selected cell.

 

Creating a Link in Aspen Graphics                           Top of Page

To create a link in Aspen Graphics, follow these steps:

    1. Single-left click on DDE from the menubar.
    2. Single-left click on Create Link.
    3. Type the symbol to be linked to the spreadsheet in the Symbol field.

DO NOT HIT ENTER!

    1. Select the quote elements you want in the link from the list in the middle of the menu. A single left click displays a description of your selection in the Element Description box. A double left click sends the element to the Selected box (a double-left click on an element in the Selected box puts it back in the original list).
      The elements you select will be displayed in Excel in the order chosen, from left to right, as an indivisible array. You won't be able switch the fields around once they are pasted into Excel, so carefully plan how you will want to view the link.
    1. Select the Copy Link button in the lower right-hand corner. The link will be pasted into the specified cell(s) in Excel.
      If you create the DDE link from within Aspen, your link is sent to the Windows® clipboard until you designate which cell(s) in Excel you would like the link to be pasted.
    1. Import the link from the clipboard to Excel by following these steps:
    1. Activate the Excel spreadsheet where you want the link.
    2. Highlight the cell(s) into which the link will be pasted.
    3. Click on the second custom button in Excel.

If the toolbar is not displayed, call Aspen Graphics Technical Support for assistance.

Creating a Symbol using DDE                           Top of Page

      Aspen Graphics allows the user to create his/her own "symbol" in Excel and import that information into the Aspen data files. This utility can be used to export both an array of historical data or live (updating) data from a spreadsheet program into Aspen Graphics. The first step in either case is to define the symbol in your Aspen Graphics Database.

      To do this, click on the third custom DDE button in Excel.

      The Create Symbol DDE Helper (see Figure 4) appears allowing you to enter all the relevant information about the symbol you are creating.

      Figure 4

      Table 1 defines and provides an example for each field in the Create Symbol Dialog box:

      Before naming your symbol, check to make sure there is not an existing symbol trading with that name. In Aspen, bring up the page Superquote, then type in the name that you want to use for the symbol you are creating. If the message "<name_of_symbol> undefined" appears, it is okay to use that name for your symbol. If it is quoted, try a more descriptive name for your symbol.


Field

What To Enter

Example

Symbol Name of Symbol. Corn_Spread
Description Description of Symbol appearing on a chart or Superquote. July/Sept.
Scale Increments in which a symbol trades (same as "Units" on Superquote). 1/8
Exchange Exchange on which the instrument will trade (for synthetic symbols based on real symbols, use the exchange for the real symbol). CBOT
Type Type of Instrument (stock, future, option, etc.). Future
Base 100 Only for interest rate futures subtracted from 100. (leave blank)
Currency Currency in which the instrument trades. US Dollars
Amount/Pt Dollar value of a one-point move. 50
Volatility Base volatility at-the-money; optional. (leave blank)

Field

What To Enter

Example

Minimum Tick Minimum number of ticks per trade (If the smallest amount a symbol can uptick or downtick is 1/8, the minimum tick should be 1). 1
Expiration Date of Expiration of your symbol. 12/31/97
Trading Hours Session start and ending times, and time zone of exchange (left blank, these will default to the exchange entered above). (leave blank)
If symbol Type is an Option, these additional fields need to be entered:
Strike Price Strike price of the option. 285
Underlying Symbol Symbol for the underlying instrument of the option. Cn7
Strike Scale Minimum strike units. 1
Put/Call What kind of option is being created? Call
Option Type American (exercise before or at expiration) or European (exercise at expiration only). American

Table 1

Once the fields in the Create Symbol DDE Helper box have entries, select OK. The new symbol is automatically entered into the Aspen Graphics Symbol Info List. It will now be defined in the Aspen Graphics system but there won't be any price data for it yet.

 

Exporting historical data from Microsoft® Excel                           Top of Page

        Before the data can be assigned to a symbol, the symbol must be defined
        using the method described in the previous sections.

        The order of the data in Excel is very important. You must have the data in the same order as the data file that you want to write to. Figure 5 is an example of daily data in Excel that can be written.

        First Cell Second Cell

        Corn_Spread hloc
        5/1/97 6:00

        16

        13.75

        14

        16

        5/2/97 6:00

        15.75

        14.5

        14.5

        15.25

        5/5/97 6:00

        16.5

        15

        15

        16.5

        5/6/97 6:00

        16.5

        16

        16.5

        16

        5/7/97 6:00

        16.5

        15

        16.5

        15

        5/8/97 6:00

        15

        14.5

        15

        14.75

        Figure 5

        Figure 5 shows an array of data. In addition to the date, time, high, low, open and close for each day, there is a top row of information which tells Aspen where to assign this new data. The first cell of the top row contains the name of the symbol you created. The second cell is a code which signifies the order of the data in the table. Table 2 lists the five choices for the contents of the second cell.

         

        Contents of 2nd Cell Type of Data Aspen Datafile Order of Data in the array
        TICKHIST Tick data Ticks.dat Date, Time, Price, Volume
        HLOC,15 15 minute data Bars.dat Date, Time, High, Low, Open, Close
        HLOCV,15 15 minute data Bars.dat Date, Time, High, Low, Open, Close, Volume, Open Interest
        HLOC Daily data Days.dat Date, Time, High, Low, Open, Close
        HLOCV Daily data Days.dat Date, Time, High, Low, Open, Close, Volume, Op Int

        Table 2

        To export the data into Aspen, highlight the entire array (Top Row and Body), and single-left click on the fourth custom Aspen button.

Using the AspenTick Function                           Top of Page

The AspenTick function allows dynamic links to be created from Excel to be exported to Aspen Graphics in real time. The AspenTick value will automatically update in Aspen each time the value changes in Excel. First, create a symbol using the method described in the section Creating a Symbol Using DDE.

The AspenTick function sends information to Aspen as tick data. It will be written to the ticks.dat data file. You'll be able to see it in a tick or intraday chart or in a quote window. You won't be able to view this data on a daily (or higher time frame) chart, because those charts reference the days.dat datafile. To chart information from Excel on a daily chart, use the method described in the previous section Exporting Historical Data from Excel.

Once you have a cell in Excel that is producing the values you want to export to Aspen, follow these steps:

    1. Single-left click on Insert from the Excel menubar.
    2. Single-left click on Function….
    3. In the Function Category section on the left, select ALL.
    4. In the Function Name section on the right, double-left click on AspenTick. The AspenTick Setup Window (see Figure 6) will be displayed:

Figure 6

Table 3 provides an explanation for each of the Aspen Tick fields.

 

 

Name of field What to Enter
Symbol Enter the name of the symbol you created.
Price Single-left click on the cell which contains the value that you want to link to Aspen.
The next three fields are optional:
Count To have this link update only when its value changes, enter a zero (0). If this field is left blank, the link will update any time any link on the spreadsheet updates.
Bate If you want to define the price as a TRADE, BID, ASK, SETTLE, OPEN or CLOSE, enter that quote code here. If left blank, it will default to Trade.
TkVol Enter the tick volume associated with the price. If left blank, the value will be 1.

Table 3

    1. A single-left click on Finish will return you to the spreadsheet.
    2. Switch back to Aspen and display a tick chart (0 minute), and enter the name of the symbol you created. You should see dots plotted on the chart as the value updates in Excel.

Top of Page