Configuration Tables

Configuration Tables

A database must contain two configuration tables used by RTD.DB.

The first table configures RTD or DDE formulas. The second table configures updateable tables.

Use the install.sql file in the RTD Databases folder of the downloaded package to create tables in any supported database platform.

Read the Concept topic to have basic knowledge about configuring tables.

Formula Configuration

RTD.DB reads the formula configuration from the table that contains the following fields:

  1. TABLE_SCHEMA
  2. TABLE_NAME
  3. COLUMN_NAME
  4. RTD_FORMULA
  5. IS_DISABLED

The table can contain an additional primary key first column.

Configuration data formats:

TABLE_SCHEMATABLE_NAMECOLUMN_NAMERTD_FORMULAIS_DISABLED
<Table schema><Table name><Column name><RTD or DDE formula>1/0/NULL

The TABLE_SCHEMA and TABLE_NAME fields specify a database table.

The COLUMN_NAME field specifies a column of database tables.

The RTD_FORMULA column specifies an RTD or DDE formula used to get real-time data.

The IS_DISABLED field allows disabling field updating. Use this if you do not want to delete the row.

Formula format is very similar to Microsoft Excel. However, the formulas must contain a parameter in square brackets instead of real tickers.

This is an example of the configuration table:

TABLE_SCHEMATABLE_NAMECOLUMN_NAMERTD_FORMULA
rtdQuotesESCode
rtdQuotesESSymbol=RTD("esrtd",,[Code],"Symbol")
rtdQuotesESTime=RTD("esrtd",,[Code],"Time")
rtdQuotesESLast=RTD("esrtd",,[Code],"Last")
rtdQuotesESChange=RTD("esrtd",,[Code],"Change")
rtdQuotesESPercentChange=RTD("esrtd",,[Code],"% Change")
rtdQuotesESOpen=RTD("esrtd",,[Code],"Open")
rtdQuotesESHigh=RTD("esrtd",,[Code],"High")
rtdQuotesESLow=RTD("esrtd",,[Code],"Low")
rtdQuotesESVolume=RTD("esrtd",,[Code],"Volume")
rtdQuotesTOSSymbol
rtdQuotesTOSTime=Time()
rtdQuotesTOSLast=TOS|LAST![Symbol]
rtdQuotesTOSChange=TOS|NET_CHANGE![Symbol]
rtdQuotesTOSPercentChange=TOS|PERCENT_CHANGE![Symbol]
rtdQuotesTOSOpen=TOS|OPEN![Symbol]
rtdQuotesTOSHigh=TOS|HIGH![Symbol]
rtdQuotesTOSLow=TOS|LOW![Symbol]
rtdQuotesTOSClose=TOS|CLOSE![Symbol]
rtdQuotesTOSVolume=TOS|VOLUME![Symbol]

The columns of the rtd.QuotesES table are updated from the eSignal FutureSource real-time RTD server ("esrtd").

The columns of the rtd.QuotesTOS table are updated from the Thinkorswim thinkDesktop real-time DDE server ("TOS").

rtd.QuotesES contains the Code column that is used as a parameter.
The Code column belongs to a task table (see below) and does not exist in rtd.QuotesES.
However, such parameter fields must be specified in the field configuration table to load parameter columns into the table column set.

rtd.QuotesTOS contains the Symbol column that is used as a parameter.

rtd.QuotesTOS contains the Time column calculated by RTD.DB as TOS have no time fields.
See the complete list of built-in functions.

Table Configuration

RTD.DB reads the table configuration from the table that contains the following fields:

  1. TABLE_SCHEMA
  2. TABLE_NAME
  3. LOAD_CODE
  4. IS_HISTORY
  5. IS_DISABLED
  6. TIME_ZONE
  7. RTD_INSTANCE_NAME

The table can contain an additional primary key first column.

Configuration data formats:

TABLE_SCHEMATABLE_NAMELOAD_CODEIS_HISTORYIS_DISABLEDTIME_ZONERTD_INSTANCE_NAME
<Table schema><Table name><SQL command>1/0/NULL1/0/NULL<Time Zone><Instance Name>

The TABLE_SCHEMA and TABLE_NAME fields specify a database table.

The LOAD_CODE field specifies the SQL code used to load tickers to update. For example:

SELECT DISTINCT Symbols FROM dbo.WatchList UNION SELECT DISTINCT Symbols FROM dbo.Portfolio

The IS_HISTORY field allows switching on the history mode.

In this mode, RTD.DB uses insert commands to update data first, and then uses the update command if the inserting has failed.

The IS_DISABLED field allows turning off the table update.

The TIME_ZONE field defines the time zone of the table. This time zone is used to adjust the current PC time in built-in functions like =Time().

Specify 'Eastern Standard Time' for US exchanges.
See available time zones at http://technet.microsoft.com/en-us/library/cc749073(v=ws.10).aspx.

The RTD_INSTANCE_NAME field specifies an RTD.DB instance that updates the table. Other instances ignore the table.

RTD.DB Personal and RTD.DB Standard have two instances: x86 for the 32-bit and x64 for 64-bit RTD.DB executables.
RTD.DB Enterprise supports user defined names configured in the application configuration file.

This is an example of table configuration:

TABLE_SCHEMATABLE_NAMELOAD_CODEIS_HISTORYIS_DISABLED
rtdQuotesESSELECT Code FROM rtd.QuoteListES1
rtdQuotesTOSSELECT Code AS Symbol FROM rtd.QuoteListTOS

The second row selects codes 'AS Symbol'. This trick required to select tickers with the column name specified in the formula configuration table.

Creating Configuration Tables

As mentioned above, use the install.sql file in the RTD Databases folder of the downloaded package to create tables in any supported database platform.

The RTD Databases folder also contains ready-to-use templates to create data tables including required configuration formulas.