Understanding RTD DB Configuration Tables

Understanding RTD DB Configuration Tables

RTD DB requires two internal configuration tables:

  1. A table for RTD or DDE formulas.
  2. A table for updateable tables.

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

Refer to the Concept topic for an overview of configuring tables.

Formula Configuration

RTD DB retrieves formula configurations from a table containing the following fields:

  1. table_schema
  2. table_name
  3. column_name
  4. rtd_formula
  5. is_disabled

An additional primary key column may be included.

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 the database table.
  • The column_name field specifies a column within the database table.
  • The rtd_formula column specifies the RTD or DDE formula used to retrieve real-time data.
  • The is_disabled field allows for the temporary disabling of field updates without removing the row.

Formulas must follow the same format as Microsoft Excel, but they should include a parameter in square brackets instead of actual tickers.

Example Configuration Table:

table_schematable_namecolumn_namertd_formula
rtdtos_historical_pricessymbol
rtdtos_historical_pricesdate=Date()
rtdtos_historical_pricestime=Time()
rtdtos_historical_priceslast=TOS|LAST![Symbol]
rtdtos_historical_priceschange=TOS|NET_CHANGE![Symbol]
rtdtos_historical_pricespercent_change=TOS|PERCENT_CHANGE![Symbol]
rtdtos_historical_pricesopen=TOS|OPEN![Symbol]
rtdtos_historical_priceshigh=TOS|HIGH![Symbol]
rtdtos_historical_priceslow=TOS|LOW![Symbol]
rtdtos_historical_pricesclose=TOS|CLOSE![Symbol]
rtdtos_historical_pricesvolume=TOS|VOLUME![Symbol]

The columns of the tos_historical_prices table are updated from the thinkorswim desktop real-time DDE server ("TOS"). The symbol column serves as a dynamic parameter, while the time column is calculated by RTD DB, as TOS does not provide time fields.

Refer to the complete list of built-in functions.

Table Configuration

RTD DB retrieves table configurations from a table containing 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

An additional primary key column may be included.

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 the database table.
  • The load_code field specifies the SQL code used to load tickers for updates. For example:
SELECT DISTINCT Symbols FROM dbo.WatchList UNION SELECT DISTINCT Symbols FROM dbo.Portfolio
  • The is_history field enables history mode. In this mode, RTD DB uses insert commands to update data first, followed by update commands if the insert fails.
  • The is_disabled field allows for disabling table updates.
  • The time_zone field defines the time zone of the table, which is used to adjust the current PC time in built-in functions like =Time(). Specify Eastern Standard Time for US exchanges. Refer to available time zones at https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11.
  • The rtd_instance_name field specifies the RTD DB instance responsible for updating the table. Other instances will ignore the table.

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

Example Table Configuration:

table_schematable_nameload_codeis_historyis_disabled
rtdtos_historical_pricesSELECT symbol FROM rtd.tos_stock_list

Creating Configuration Tables

To create the tables, use the install.sql file in the RTD Databases folder of the downloaded package. This file facilitates table creation across any supported database platform.

The RTD Databases folder also contains ready-to-use templates for creating data tables, along with predefined configuration formulas.

This website is using cookies. By continuing to browse, you give us your consent to our use of cookies as explained in our Cookie Policy.