StreamBase Documentation


The StreamBase Adapter for Excel

So far in this introduction to StreamBase, we have looked at the application design and development features that are included in every StreamBase installation. StreamBase also offers some tools that you can install separately to extend its base functionality. We'll take a brief look at one of them here.

Customers in application areas such as automated trading, risk management, and feed processing have told StreamBase that they frequently work with data using spreadsheets. In response, StreamBase has created an implementation of the Microsoft RTD server. The adapter runs on Windows systems with Microsoft Excel 2002 or higher installed. It enables Excel users to dynamically display application output and manipulate tuple data using familiar Excel functions.

The adapter can be used in two modes, where the data flows in opposite directions:

  • Dequeueing tuples from one or more StreamBase application output streams and passing them to Excel.
  • Publishing tuples from Excel to a StreamBase application.
StreamBase Excel Adapter components

The diagram above illustrates: a StreamBase application receives a stream of tuples from a data feed, processes the data, and emits the data on an output stream. The RTD adapter, listening to the StreamBase server, receives the data and passes it to Excel. The diagram also shows the publishing option, where tuples are enqueued from an Excel spreadsheet into a StreamBase application for processing there.

Formatting Tuples in Excel

In your spreadsheet, you can format tuples using the built-in capabilities of Excel (including pivot tables). Two methods are particularly useful for displaying tuples dynamically. In the following output of the sample StreamBase application that is installed with this adapter, notice that the spreadsheet is organized into several grids.

Excel spreadsheet showing RTD function to display tuple output from a StreamBase application.
  • Historical topics are associated with the relative order of tuples in the output stream. In the preceding example, the Ticker Stream grid displays ten rows of tuples in the historical mode: the top row represents the most recent output tuple. A new output tuple will replace this one in the top position, and the current tuple will move one row down; in this way, tuples may scroll down as data is output, disappearing beyond the bottom row. The historical grid can show as many tuples at one time as the number of rows you create.
  • Filtered topics are associated with key schema fields. For example, a row might display only tuples that contain a certain ticker symbol.

    In the preceding figure, the Latest Values block of five rows contains filtered fields. Filtered data is updated in place instead of moving in the grid. For example, the AAPL row displays only fields for tuples whose symbol is AAPL, and it is updated each time an AAPL tuple is emitted on the output stream. Thus, the grid shows data from only the most recent AAPL tuple.

    The third and fourth groups combine the filtering and historical modes. Large Volumes displays the last five trades exceeding 9000 shares, while Microsoft Buy History displays the last five buy orders for Microsoft.

Setting Up a Spreadsheet and Running the StreamBase Adapter for Excel

This section briefly describes the process of setting up and running the StreamBase Adapter for Excel. Detailed instructions are provided in the adapter documentation.

Setting up an Excel spreadsheet for use with the adapter involves creating the grid you want, adding an Excel RTD function to cells where you want to display StreamBase data dynamically, and saving your spreadsheet. This prepares Excel to receive dequeued tuples from a StreamBase application.

If you intend to publish tuples from Excel to a StreamBase application, you must add several lines of VBA code to your Excel spreadshseet. The rtd-publish.xls sample spreadsheet that ships with the adapter contains this VBA code and illustrates how to publish tuples to StreamBase.

Running the adapter involves the following steps:

  1. Start your StreamBase application.
  2. Start the data feed for your application (if deployed, this might be an equeuing program; it you are designing your application, it might be a StreamBase Studio feed simulator).
  3. Open your spreadsheet in Excel.

To help you get started, detailed documentation and a sample application are included with the StreamBase Adapter for Excel kit. The sample is installed in the microsoft-rtd/sample directory. The sample directory contains a simple StreamBase application, a feed simulator, and a several sample spreadsheets.

Next Topic

Summary »

Back to Top ^