RTD.DB 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:
- TABLE_SCHEMA
- TABLE_NAME
- COLUMN_NAME
- RTD_FORMULA
- IS_DISABLED
The table can contain an additional primary key first column.
Configuration data formats:
TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | RTD_FORMULA | IS_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_SCHEMA | TABLE_NAME | COLUMN_NAME | RTD_FORMULA |
---|---|---|---|
rtd | QuotesES | Code | |
rtd | QuotesES | Symbol | =RTD("esrtd",,[Code],"Symbol") |
rtd | QuotesES | Time | =RTD("esrtd",,[Code],"Time") |
rtd | QuotesES | Last | =RTD("esrtd",,[Code],"Last") |
rtd | QuotesES | Change | =RTD("esrtd",,[Code],"Change") |
rtd | QuotesES | PercentChange | =RTD("esrtd",,[Code],"% Change") |
rtd | QuotesES | Open | =RTD("esrtd",,[Code],"Open") |
rtd | QuotesES | High | =RTD("esrtd",,[Code],"High") |
rtd | QuotesES | Low | =RTD("esrtd",,[Code],"Low") |
rtd | QuotesES | Volume | =RTD("esrtd",,[Code],"Volume") |
rtd | QuotesTOS | Symbol | |
rtd | QuotesTOS | Time | =Time() |
rtd | QuotesTOS | Last | =TOS|LAST![Symbol] |
rtd | QuotesTOS | Change | =TOS|NET_CHANGE![Symbol] |
rtd | QuotesTOS | PercentChange | =TOS|PERCENT_CHANGE![Symbol] |
rtd | QuotesTOS | Open | =TOS|OPEN![Symbol] |
rtd | QuotesTOS | High | =TOS|HIGH![Symbol] |
rtd | QuotesTOS | Low | =TOS|LOW![Symbol] |
rtd | QuotesTOS | Close | =TOS|CLOSE![Symbol] |
rtd | QuotesTOS | Volume | =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, the field configuration table must specify such parameter fields 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 has 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:
- TABLE_SCHEMA
- TABLE_NAME
- LOAD_CODE
- IS_HISTORY
- IS_DISABLED
- TIME_ZONE
- RTD_INSTANCE_NAME
The table can contain an additional primary key first column.
Configuration data formats:
TABLE_SCHEMA | TABLE_NAME | LOAD_CODE | IS_HISTORY | IS_DISABLED | TIME_ZONE | RTD_INSTANCE_NAME |
---|---|---|---|---|---|---|
<Table schema> | <Table name> | <SQL command> | 1/0/NULL | 1/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 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 https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11.
The RTD_INSTANCE_NAME field specifies an RTD.DB instance that updates the table. Other instances ignore the table.
RTD.DB Personal and Standard editions 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_SCHEMA | TABLE_NAME | LOAD_CODE | IS_HISTORY | IS_DISABLED |
---|---|---|---|---|
rtd | QuotesES | SELECT Code FROM rtd.QuoteListES | 1 | |
rtd | QuotesTOS | SELECT Code AS Symbol FROM rtd.QuoteListTOS |
The second row selects codes AS Symbol
. This trick is 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 the required configuration formulas.
Contents
- Formula Configuration
- Table Configuration
- Creating Configuration Tables