RTD.DB

RTD.DB

Getting Started

A number of trading and analytical platforms allows updating data in Microsoft Excel.

The platforms implement RTD or DDE servers, and the common picture looks like this:

Using Real-Time Data in Microsoft Excel

You may get data in Microsoft Excel using RTD or DDE formulas like this:

=RTD("tos.rtd",,"LAST","AAPL")
=RTD("tos.rtd",,"OPEN","AAPL")
=RTD("tos.rtd",,"HIGH","AAPL")
=RTD("tos.rtd",,"LOW","AAPL")
=RTD("tos.rtd",,"VOLUME","AAPL")

RTD.DB acts as Microsoft Excel for such servers, however, saves data to databases:

Saving Real-Time Data to Database

RTD.DB has the same formula format.

You may specify what tables and what columns to update using formulas like this:

TABLE_SCHEMATABLE_NAMECOLUMN_NAMERTD_FORMULA
rtdQuotesTOSSymbol 
rtdQuotesTOSLast=RTD("tos.rtd",,"LAST",[Symbol])
rtdQuotesTOSOpen=RTD("tos.rtd",,"OPEN",[Symbol])
rtdQuotesTOSHigh=RTD("tos.rtd",,"HIGH",[Symbol])
rtdQuotesTOSLow=RTD("tos.rtd",,"LOW",[Symbol])
rtdQuotesTOSVolume=RTD("tos.rtd",,"Volume",[Symbol])

RTD.DB includes ready-to-use formulas for several trading platforms like Thinkorswim and Trader Workstation.

You may configure formulas for any RTD or DDE data source yourself.

RTD.DB supports multiple database platforms including Microsoft SQL Server, Oracle Database, and MySQL.

The most typical usage scenarios are

  • Creating history tables for stocks, options, futures, and currencies in different time frames.
  • Getting option chains for a wide range of stocks.

For example, you may create a history of option data yourself loading data day-by-day.
Option data history is the most expensive in the market and does not contain all fields available in trading platforms.

For the second case, you may load all options for actively traded stocks.
For example, Thinkorswim allows refreshing about 200 tickers at once. RTD.DB cycles tickers and, so, loads any number of options.

So, RTD.DB is a great tool for traders and investors who need to accumulate real-time data in a database.

Start learning with the following topics:

What's New

Version 5.6, November 3, 2017

Bug fixes:

  • Registration wizard WebException in the offline mode

Version 5.5, August 22, 2017

Breaking changes:

  • Changed .NET platform from .NET Framework 4.0 Client Profile to .NET Framework 4.5.2.
  • Changes in requirements for Windows 7, Windows Server 2008, and Windows Server 2008 R2.
  • Removed support of Windows XP.
  • Removed support of SQL Server 2000.
  • Removed support of MySQL 5.0, 5.1, 5.2.
  • Removed support of MariaDB 5.1, 5.2, 5.3.

Bug Fixes:

  • Issues with registering products.

Version 5.4, August 1, 2017

New features:

  • Azure Active Directory integrated authentication
  • Azure Active Directory password authentication

Version 5.3, July 5, 2017

Improvements:

  • Updated registration wizard
  • Updated installer

Bug Fixes:

  • Wrong ticker limits in RTD.DB Personal

Version 5.2, May 31, 2017

Improvements:

  • Updated installer
  • Updated documentation

Version 5.1, May 11, 2017

Improvements:

  • Support of ODBC Driver 13 for SQL Server
  • Improved Spanish translation
  • Improved documentation

Version 5.0, May 1, 2017

RTD.DB 5.0 is a major upgrade of RealTimeToDB.

The new name reflects the main application role, saving data from RTD and DDE servers to databases.

Existing users may install RTD.DB as a new product, test it and purchase the upgrade. See upgrade notes.

Licensing Changes

RTD.DB has a new free edition that allows getting data for 10 tickers.

Paid editions have a new simplified model of limits. The Personal and Standard editions have increased limits of updated rows.

See Edition Comparison.

The trial period is changed from 30 days to 15 days. Registration is required to start a trial.

RTD.DB is available as a subscription.

Major upgrades become paid. You may purchase Upgrade Warranty with new purchases to get major upgrades for free.

Improvements:

  • Redesigned RTD database. See Database Templates.
  • Rewritten documentation. Please read Concept and Configuring Tables.
  • You may use OCC option codes like AAPL180119C0015000 in ticker tables for Thinkorswim Desktop.
    The application converts option codes to the Thinkorswim format like .AAPL180119C150 automatically.
  • Expired option codes loaded from ticker tables are ignored.

Other Changes

RTD.DB does not include the default SQL Server Compact database with activated RealTimeToExcel.

The RTD.DB setup package does not install RealTimeToExcel and related menu topics.

We made this change as the most of the product users use SQL Server and MySQL databases, loading data from trading platforms like Thinkorswim or Trader Workstation and paid data sources from vendors like eSignal or Bloomberg.

The newest RTD.DB version has a clear database structure and a clear concept to implement such tasks with fewer efforts.

You may still use your SQL CE database, or create a new one, and to install RealTimeToExcel separately.

Edition Comparison

RTD.DB allows updating databases with real-time data from trading platforms and paid data sources that support RTD or DDE.

FeatureFreePersonalStandardEnterprise
Number of updated tickers1010002000Unlimited
Custom named instances *xxx
Last value, day, time, and tick history tables
Multi-threading, low latency
32-bit and 64-bit RTD and DDE servers
One-time price per copy $99$199$399
Commercial usex

You may try all the features during a 15-day trial period.

* RTD.DB Enterprise supports multiple named instances located in different folders.

Tested RTD servers:

  • ThinkDesktop, Thinkorswim, a division of TD Ameritrade
  • FutureSource, eSignal

Tested DDE servers:

  • ThinkDesktop, Thinkorswim, a division of TD Ameritrade
  • Trader Workstation, Interactive Brokers
  • VertexFX Trader, Hybrid Solutions

Supported database platforms:

  • Microsoft SQL Server
  • Microsoft SQL Server Compact
  • Oracle Database
  • IBM DB2
  • MySQL and MariaDB
  • PostgreSQL
  • NuoDB

Install and Uninstall

Installing

To install RTD.DB, unzip the downloaded RTD.DB package and run setup.exe.

Register the application to start a trial period.

Read Concept to learn how to configure your database to get data from trading platforms.

See also Database Templates.

Updating

To update RTD.DB, unzip the downloaded RTD.DB package and run setup.exe.

Uninstalling

To uninstall RTD.DB, open Control Panel, Programs and Features, then select RTD.DB and click the Uninstall button.

Upgrading from RealTimeToDB 1.x to 4.x

RTD.DB is the next major version of RealTimeToDB. However, RTD.DB is a new product.

So, you may have both RealTimeToDB and RTD.DB installed and test the upgrade with a minimal service interruption.

You may test the upgrade in a trial mode and purchase the upgrade to continue use of RTD.DB.

RTD.DB includes the redesigned RTD database. The main install.sql file installs configuration tables only. Other tables are available as Database Templates.

You may continue to use your existing databases as is. RTD.DB 5.0 has the same configuration table structures.

System Requirements

Tested RTD Servers

  • ThinkDesktop, Thinkorswim, division of TD Ameritrade
  • FutureSource, eSignal

Tested DDE Servers

  • ThinkDesktop, Thinkorswim, division of TD Ameritrade
  • Trader Workstation, Interactive Brokers
  • VertexFX Trader, Hybrid Solutions

Supported Architectures:

  • x86, x64

Supported Operating Systems:

  • Windows Vista SP2, 7 SP1, 8, 8.1, 10
  • Windows Server 2008 SP2, 2008 R2 SP1, 2012, 2012 R2, 2016

Supported Versions of Microsoft SQL Server:

  • Microsoft SQL Server 2005, 2008, 2008 R2, 2012, 2014, 2016 including Express LocalDB
  • Microsoft Azure SQL Database

Supported Versions of Microsoft SQL Server Compact:

  • Microsoft SQL Server Compact 3.5, 4.0

Supported Versions of Oracle Database:

  • Oracle Database 10g R1/R2, Oracle Database 11g R1/R2, Oracle Database 12c R1

Supported Versions of IBM DB2:

  • IBM DB2 9.5, 9.7, 9.8, 10.1, 10.5, 11.1

Supported Versions of MySQL:

  • MySQL 5.5, 5.6, 5.7

Supported Versions of SkySQL MariaDB:

  • MariaDB 5.5, 10.0, 10.1, 10.2

Supported Versions of NuoDB:

  • NuoDB 2.0.4, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6

Supported Versions of PostgreSQL:

  • PostgreSQL 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, 9.2, 9.3, 9.4

End-User License Agreement

This End-User License Agreement (EULA) is a legal agreement between you (either an individual or a single entity) and Gartle Technology Corporation for any RTD.DB software, use examples and documentation (Software) that accompany this EULA.

YOU AGREE TO BE BOUND BY THE TERMS OF THIS EULA BY INSTALLING, COPYING, OR OTHERWISE USING THE SOFTWARE.

IF YOU DO NOT AGREE, DO NOT INSTALL, COPY, OR USE THE SOFTWARE.

Your licensing of Software is in accordance with the terms of the EULA in effect at the time of such licensing. By licensing Software, you accept and agree to the EULA in effect at such time.

  1. GRANT OF LICENSE: Gartle Technology Corporation grants you the following rights provided that you comply with all terms and conditions of this EULA:
    1. Trial Period: You may install, use, access, display and run the Software for purposes of evaluation of the Software for a period of fifteen (15) days from the date of installation of the Software to determine if the Software meets your needs. Upon completion of your evaluation or at the end of the 15-day trial period, whichever occurs first, you must do one of four things: either
      1) register the RTD.DB Free edition in order to continue use of Software;
      2) purchase license for the RTD.DB Personal, Standard or Enterprise edition in order to continue use of Software;
      3) purchase a subscription for the RTD.DB Personal, Standard or Enterprise edition in order to continue use of Software;
      or 4) discontinue use of the Software, and uninstall the Software from any and all machines.
    2. Installation and Use: You may install, use, access, display and run one (1) copy of the Software per license, on a non-exclusive basis and without right of sublicense or concurrent use, on a single computer or machine, such as a workstation.
      The commercial use of the RTD.DB Personal edition is not permitted, including the use by professional traders and institutional investors.
    3. Software Transfer: You may transfer the Software to a different internal workstation or user so long as you have purchased a License for each such workstation or user. You may not, however, transfer the Software to a Third Party.
    4. Use of Examples: You may install, access, modify and use Software examples, including Microsoft Excel workbooks, databases, SQL codes, and batch files, for your private or company-internal purposes.
  2. LIMITATIONS: You may not use, copy, modify, display, rent, lease, loan, transfer, distribute, download, merge, or make any translation or derivative work of the Software, except as expressly provided herein. You may not reverse engineer, decompile, or disassemble the Software, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation.
  3. INTELLECTUAL PROPERTY RIGHTS AND CONFIDENTIALITY: The Software, including methods, processes and/or techniques utilized therein, is owned by, proprietary to and valuable trade secrets of Gartle Technology Corporation and is protected by Russian Federation copyright law and international treaties. You agree to take no actions that impair or infringe Gartle Technology Corporation's intellectual property rights in the Software. You agree not to remove, efface or obscure any copyright notices, other proprietary markings or confidentiality legends placed upon or contained within the Software.
  4. DISCLAIMER OF WARRANTIES: Gartle Technology Corporation disclaims all warranties concerning the Software and Services (if any), express, implied, or statutory, including without limitation, any warranties, duties or conditions of merchantability or fitness for a particular purpose, warranties of reliability or availability, of accuracy or completeness of responses, of results, of workmanlike effort, of lack of viruses, and of lack of negligence, all with regard to the Software, and the provision of or failure to provide support or other services, information, software, and related content through the Software or otherwise arising out of the use of the Software. Gartle Technology Corporation does not warrant that the Software will operate in combination with other software products selected by you, or that the Software will operate uninterrupted or error-free. Additionally, Gartle Technology Corporation and its suppliers provide the Software and Services AS IS AND WITH ALL FAULTS. THERE IS NO WARRANTY OR CONDITION OF TITLE, QUIET ENJOYMENT, QUIET POSSESSION, CORRESPONDENCE TO DESCRIPTION, OR NONINFRINGEMENT WITH REGARD TO THE SOFTWARE.
  5. NO LIABILITY: TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL GARTLE TECHNOLOGY CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL, PUNITIVE, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR LOSS OF PROFITS OR CONFIDENTIAL OR OTHER INFORMATION, FOR LOSS OF DATA, FOR BUSINESS INTERRUPTION, FOR PERSONAL INJURY, FOR LOSS OF PRIVACY, FOR FAILURE TO MEET ANY DUTY INCLUDING OF GOOD FAITH OR OF REASONABLE CARE, FOR NEGLIGENCE, AND FOR ANY OTHER PECUNIARY OR OTHER LOSS WHATSOEVER) ARISING OUT OF OR IN ANY WAY RELATED TO THE USE OF OR INABILITY TO USE THE SOFTWARE, THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT OR OTHER SERVICES, INFORMATION, SOFTWARE, AND RELATED CONTENT THROUGH THE SOFTWARE OR OTHERWISE ARISING OUT OF THE USE OF THE SOFTWARE, OR OTHERWISE UNDER OR IN CONNECTION WITH ANY PROVISION OF THIS EULA, EVEN IN THE EVENT OF THE FAULT, TORT (INCLUDING NEGLIGENCE), MISREPRESENTATION, STRICT LIABILITY, BREACH OF CONTRACT OF GARTLE TECHNOLOGY CORPORATION OR ANY SUPPLIER, AND EVEN IF GARTLE TECHNOLOGY CORPORATION OR ANY SUPPLIER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  6. LIMITATION ON REMEDIES: Within the first thirty (30) days after your receipt of the Software, should you encounter and report to Gartle Technology Corporation within such time period a reproducible error that causes the Software not to perform in all material respects as set forth in the Software documentation, then Gartle Technology Corporation will, at its sole discretion, either: a) resolve the error or malfunction, and modify or replace the Software (if deemed necessary by Gartle Technology Corporation); or b) allow you to terminate this EULA with respect to the non-conforming Software and, upon your return of the Software to Gartle Technology Corporation, Gartle Technology Corporation shall provide you with the lesser of a) the actual damages incurred by you; or b) the amount you paid for the non-conforming Software. The remedies described in this section shall be your sole and exclusive remedies under this EULA.
  7. GENERAL PROVISIONS
    1. Reservation of Rights and Ownership: Gartle Technology Corporation reserves all rights not expressly granted to you in this EULA. The Software is licensed, not sold.
    2. Consent to Use of Data: You agree that Gartle Technology Corporation and its affiliates may collect and use technical information gathered as part of the Software support services provided to you, if any, related to the Software. Gartle Technology Corporation may use this information solely to improve Gartle Technology Corporation products or to provide customized services or technologies to you and will not disclose this information in a form that personally identifies you.
    3. Links to Third Party Sites: We may link to third-party-sites through the use of the Software. The third-party sites are not under the control of Gartle Technology Corporation, and Gartle Technology Corporation is not responsible for the contents of any third-party sites, any links contained in third-party sites, or any changes or updates to third-party sites. Gartle Technology Corporation is not responsible for webcasting or any other form of transmission received from any third-party sites. Gartle Technology Corporation is providing these links to third-party sites to you only as a convenience, and the inclusion of any link does not imply an endorsement by Gartle Technology Corporation of the third-party site.
    4. Additional Software/Services: This EULA applies to updates, supplements, add-on components, or Internet-based services components, of the Software that Gartle Technology Corporation may provide to you or make available to you after the date you obtain your initial copy of the Software, unless Gartle Technology Corporation provides other terms along with the update, supplement, add-on component, or Internet-based services component. Gartle Technology Corporation reserves the right to discontinue any Internet-based services provided to you or made available to you through the use of the Software.
    5. Upgrades: To use Software identified as an upgrade, you must first be licensed for the software identified by Gartle Technology Corporation as eligible for the upgrade. After upgrading, you may no longer use the software that formed the basis for your upgrade eligibility.
    6. Applicable Law: This EULA is governed by the laws of the Russian Federation. Any legal action or proceeding relating to this EULA shall be instituted in a court of arbitration in the Moscow City, Russian Federation. Gartle Technology Corporation and you agree to submit to the jurisdiction of, and agree that venue is proper in, these courts in any such action or proceeding. The prevailing party in any action to enforce this EULA will be entitled to recover its attorney fees and costs in connection with such action.
    7. Waiver: The failure of either party to enforce any of the terms of this EULA shall not be construed as a waiver of future enforcement of that or any other term.
    8. Entire Agreement and Severability: This EULA (including any addendum or amendment to this EULA which is included with the Software) is the entire agreement between you and Gartle Technology Corporation relating to the Software and the support services (if any) and it supersedes all prior or contemporaneous oral or written communications, proposals and representations with respect to the Software or any other subject matter covered by this EULA. To the extent the terms of any Gartle Technology Corporation policies or programs for support services conflict with the terms of this EULA, the terms of this EULA shall control. If any provision of this EULA is held to be void, invalid, unenforceable or illegal, the other provisions shall continue in full force and effect.
    9. Termination: Without prejudice to any other rights, Gartle Technology Corporation may terminate this EULA if you fail to comply with the terms and conditions of this EULA. In such event, you must destroy all copies of the Software and all of its component parts and you will not be entitled to any refund of monies.

Trial Version Limitations

You can use RTD.DB Enterprise during a 15-day trial period for free.

You have to activate the trial.

When the trial period has expired, you have the following options:

  1. To register the RTD.DB Free edition for free.
  2. To purchase a license and register the RTD.DB Personal, Standard or Enterprise edition.
  3. To purchase a subscription and register the RTD.DB Personal, Standard or Enterprise edition.
  4. To stop the use and remove RTD.DB from a computer.

See also

Using RTD.DB

Initial Steps

Before use, please, read the most significant topics: Concept and Configuring Tables.

When you understand the concept, take a look at Database Templates.
You will find ready-to-use SQL scripts used to create and configure data tables, or, at least, used as templates for your platform.

If you use Trader Workstation, please, specify your username in the application settings.

Start RTD.DB and specify the actual connection string using the Connection Manager from the File menu. Then click the Start button.

At this point, you should have a working solution and the RTD.DB window should look like this:

RTD.DB Interface

In this example, you see that RTD.DB updates four tables with a single data row.
The RTD server notifies and refreshes data, and RTD.DB successfully saves the data to a database.

You may learn the meaning of controls and columns in the User Interface topic.

Note that the application minimizes to the system tray by default. You may restore the application using the tray icon.

Next Steps

Please check the loaded data in data tables.

When the application works fine with test data, you may add as many tickers as you need.

If you add more the 100 tickers, please read about cycling tickers.

You may add new tables for other time frames. Use database templates and learn the built-in functions.

Also, you should better understand the configuration tables.

If you have issues, please read Troubleshooting. If you cannot find the answer, feel free to contact support

Concept

For example, we may get data in Microsoft Excel from a trading platform like thinkorswim using formulas like these:

=RTD("tos.rtd",,"LAST","AAPL")
=RTD("tos.rtd",,"OPEN","AAPL")
=RTD("tos.rtd",,"HIGH","AAPL")
=RTD("tos.rtd",,"LOW","AAPL")
=RTD("tos.rtd",,"VOLUME","AAPL")

The formulas in other trading platforms are similar.

We want to get these data in a database table with a structure:

CREATE TABLE [rtd].[QuotesTOS](
    [Symbol] [varchar](50) NOT NULL,
    [DateTime] [datetime] NULL,
    [Last] [smallmoney] NULL,
    [Open] [smallmoney] NULL,
    [High] [smallmoney] NULL,
    [Low] [smallmoney] NULL,
    [Close] [smallmoney] NULL,
    [Volume] [bigint] NULL,
  CONSTRAINT [PK_QuotesTOS_rtd] PRIMARY KEY ([Symbol])
);

We have to configure this task and then just run a trading platform and RTD.DB to update the data in a database daily.

Configuration steps include:

  1. Creating a database
  2. Creating data tables
  3. Creating ticker tables
  4. Creating configuration tables
  5. Configuring formulas
  6. Configuring data tables
  7. Configuring the connection string

Creating Databases

You may create a database on any supported database platform including the most popular free SQL Server Express and MySQL.

We recommend naming the database as "RTD" as this name is used by default in the bonus database templates.

Creating Data tables

You have to create database tables to store required data.

You may see the QuotesTOS table example above.

The downloaded RTD.DB package includes the RTD Databases folder with database templates for all supported database platforms and the tested trading platforms.
You may use the templates to create tables in a couple of minutes. Feel free to modify templates to your needs.

Creating Ticker Tables

You have to create a table that contains tickers to refresh.

In most cases, you may create separate tables for different instruments:

  • Stocks
  • Options
  • Currencies

The tables have a simple structure and must contain a column that contains tickers in the trading platform format.

To have the common column name for all instruments, let's use the 'Code' column name instead of names like 'Symbol' or 'OptionCode'.

So, the ticker table looks like this:

CREATE TABLE [rtd].[QuoteListTOS](
  [Code] [varchar](50) NOT NULL,
  CONSTRAINT [PK_QuoteListTOS_rtd] PRIMARY KEY ([Code])
);

Add first tickers to your table. Later, you may add additional tickers and delete inactive tickers.

You may skip creating special ticker tables if you already have a table with tickers in your database. Just modify the ticker table in the configuration described below.

Add tickers in your trading platform format. For example, thinkorswim accepts stock tickers like AAPL and option tickers like .AAPL180119C150.

Creating Configuration Tables

RTD.DB must "understand" what tables to update and what formulas to use.

You may configure this using two tables, RealTimeTables and RealTimeFormulas, that you have to create once.

The RealTimeTables table has the following structure in SQL Server:

CREATE TABLE [rtd].[RealTimeTables](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [TABLE_SCHEMA] [nvarchar](128) NOT NULL,
    [TABLE_NAME] [nvarchar](128) NOT NULL,
    [LOAD_CODE] [nvarchar](2000) NULL,
    [IS_HISTORY] [tinyint] NULL,
    [IS_DISABLED] [tinyint] NULL,
    [TIME_ZONE] [nvarchar](50) NULL,
    [RTD_INSTANCE_NAME] [nvarchar](50) NULL,
 CONSTRAINT [PK_RealTimeTables_rtd] PRIMARY KEY ([ID]),
 CONSTRAINT [IX_RealTimeTables_Schema_Name_rtd] UNIQUE ([TABLE_SCHEMA], [TABLE_NAME])
);

The RealTimeFormulas table has the following structure in SQL Server:

CREATE TABLE [rtd].[RealTimeFormulas](
    [ID] [int] IDENTITY(1,1) NOT NULL,
    [TABLE_SCHEMA] [nvarchar](128) NOT NULL,
    [TABLE_NAME] [nvarchar](128) NOT NULL,
    [COLUMN_NAME] [nvarchar](128) NOT NULL,
    [RTD_FORMULA] [nvarchar](255) NULL,
    [IS_DISABLED] [tinyint] NULL,
 CONSTRAINT [PK_RealTimeFormulas_rtd] PRIMARY KEY ([ID]),
 CONSTRAINT [IX_RealTimeFormulas_Schema_Name_ColumnName_rtd] UNIQUE ([TABLE_SCHEMA], [TABLE_NAME], [COLUMN_NAME])
);

We fill these tables in the next topics.

You may find the ready-to-use SQL codes to create configuration tables for all supported database platforms in the install.sql file of the database templates.

Configuring Formulas

Let's add the following settings to the RealTimeFormulas table:

TOS Quote formulas

You may see that all rows configure the rtd.QuotesTOS table.

Also, you may see known RTD formulas in the RTD_FORMULA column.

However, the ticker position contains the [Symbol] value instead of a ticker like AAPL.

This is a trick. RTD.DB substitutes the [Symbol] value with a real ticker.

The table contains two rows without RTD formulas, for the Symbol and DateTime columns.

The Symbol column gets the value of a real ticker as it has the same name.

The DateTime column gets the current date and time value adjusted to the configured time zone. See below.

The =DateTime() is an internal RTD.DB function. You may use other functions like =UtcNow(), =DateTime5(), or =Time15().

Note that you may disable updating certain columns setting 1 into the IS_DISABLED column.

Configuring Data Tables

Let's add the following settings to the RealTimeTables table:

RealTimeTable configuration (1 table)

You may see that we have added the configuration for the rtd.QuotesTOS table and specified two values, LOAD_CODE and TIME_ZONE.

The LOAD_CODE field defines an SQL code used to get tickers.

In our case, the code selects tickers from the rtd.QuoteListTOS table that we discussed above.

Of course, you may use your tables instead. Just modify the SQL code in the LOAD_CODE field.

Note an important point. The SQL code must use the AS clause to select the tickers with the column name used in the RealTimeFormulas table.

In our case, the data table and all related formulas use the Symbol name, not the Code name of the rtd.QuoteListTOS table.

So the final SQL code looks like:

SELECT Code AS Symbol FROM rtd.QuoteListTOS

The second field, TIME_ZONE, defines the time zone used to adjust the current Windows time for functions like =DateTime().

In our case, we use the 'Eastern Standard Time' time zone for the US market.

If you get data from several world's markets, you may create different tables and specify different time zones.

For example, you may create tables like QuotesTOS_US or QuotesTOS_UK.

See available time zones at http://technet.microsoft.com/en-us/library/cc749073(v=ws.10).aspx.

The RTD_INSTANCE_NAME field specifies the RTD.DB instance that must update this table.

RTD.DB Personal and RTD.DB Standard have two predefined instances: x86 for the 32-bit and x64 for 64-bit RTD.DB executables.

You may specify the instance accordingly to the bitness of the trading platform.

RTD.DB Enterprise supports user defined instances configured in the application configuration files.

You may use this feature if you load data from several world's markets and need to turn on and off RTD.DB by a scheduler.

You may disable updating certain tables setting 1 into the IS_DISABLED column.

We discuss the IS_HISTORY field below.

Configuring Connection Strings

As the final configuration step, we must specify the connection string in the RTD.DB.exe.config and RTD.DB32.exe.config files.

RTD.DB connects to the specified databases under the specified credentials.

Here is an example of the configuration file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <connectionStrings>
    <add name="rtd-mssql" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=RTD;Password=r#td_2014_abc!;User ID=rtd"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
</configuration>

You may use Connection Manager to configure connection strings in a visual mode.

Starting Application

Now, you may start a trading platform and RTD.DB.

Click the Start button, and you will see the screen like this:

RTD.DB Interface

Select data from your table in a database. You have to see new data like this:

AAPL quotes

Conclusion

We have done all configuration steps:

  1. Creating a database
  2. Creating data tables
  3. Creating ticker tables
  4. Creating configuration tables
  5. Configuring formulas
  6. Configuring data tables
  7. Configuring the connection string

You may repeat the steps for any trading platform that supports RTD or DDE and any supported database platform.

The downloaded RTD.DB package includes the RTD Databases folder that includes database templates for a range of tested trading platforms.

You may use these templates to create tables with preconfigured formulas in a couple of minutes.

Please read Configuring Tables to learn advanced topics. 

Configuring Tables

Tables of Last Values

We have created a simple table in the Concept topic:

CREATE TABLE [rtd].[QuotesTOS](
    [Symbol] [varchar](50) NOT NULL,
    [DateTime] [datetime] NULL,
    [Last] [smallmoney] NULL,
    [Open] [smallmoney] NULL,
    [High] [smallmoney] NULL,
    [Low] [smallmoney] NULL,
    [Close] [smallmoney] NULL,
    [Volume] [bigint] NULL,
  CONSTRAINT [PK_QuotesTOS_rtd] PRIMARY KEY ([Symbol])
);

and configured formulas:

TOS Quote formulas

Such tables get the latest values from trading platforms as the DateTime field is not in the primary key.

RTD.DB reads metadata from a database and executes the UPDATE command first:

UPDATE [rtd].[QuotesTOS]
SET
    [DateTime] = @DateTime, [Open] = @Open, [High] = @High, [Low] = @Low, [Close] = @Close, [Volume] = @Volume
WHERE
    [Symbol] = @Symbol;

If the symbol does not exist (@@ROWCOUNT = 0), RTD.DB executes the INSERT command:

INSERT INTO [rtd].[QuotesTOS]
    ([Symbol], [DateTime], [Last], [Open], [High], [Low], [Close], [Volume])
VALUES
    (@Symbol, @DateTime, @Last, @Open, @High, @Low, @Close, @Volume);

As discussed in the Concept topic, RTD.DB loads symbols from the ticker tables, uses the current time for internal functions, and gets other values from a trading platform using RTD formulas.

Tables of End-of-Day Values

Let's create a separate table for end-of-day values:

CREATE TABLE [rtd].[QuoteDayHistoryTOS](
    [Symbol] [varchar](50) NOT NULL,
    [Date] [date] NOT NULL,
    [Time] [time](0) NULL,
    [Last] [smallmoney] NULL,
    [Open] [smallmoney] NULL,
    [High] [smallmoney] NULL,
    [Low] [smallmoney] NULL,
    [Close] [smallmoney] NULL,
    [Volume] [bigint] NULL,
  CONSTRAINT [PK_QuoteDayHistoryTOS_rtd] PRIMARY KEY ([Symbol], [Date])
);

We have split the DateTime field to the Date and Time fields, and included the Date field to the primary key.

Let's configure the formulas in the RealTimeFormulas table:

TOS Quotes - day history formulas

As you see, we have used the =Date() and =Time() formulas for new columns.

Also, let's add the table configuration in the RealTimeTables table:

RealTimeTable configuration (2 tables)

As you see, the configuration is the same.

For this table, RTD.DB executes the UPDATE command using two primary key fields:

UPDATE [rtd].[QuotesTOS]
SET
    [Time] = @Time, [Open] = @Open, [High] = @High, [Low] = @Low, [Close] = @Close, [Volume] = @Volume
WHERE
    [Symbol] = @Symbol AND [Date] = @Date;

If the symbol does not exist (a new ticker or a new date), RTD.DB executes the INSERT command:

INSERT INTO [rtd].[QuotesTOS]
    ([Symbol], [Date], [Time], [Last], [Open], [High], [Low], [Close], [Volume])
VALUES
    (@Symbol, @Date, @Time, @Last, @Open, @High, @Low, @Close, @Volume);

So, to get end-of-day data in a database, just add the date field to the primary key and specify the =Date() function for the date field.

You may find ready-to-use templates in the RTD Databases folder of the downloaded package.

Intraday History Tables

Let's create a table for 15-minute history:

CREATE TABLE [rtd].[Quote15MinuteHistoryTOS](
    [Symbol] [varchar](50) NOT NULL,
    [DateTime] [datetime] NULL,
    [Date] [date] NOT NULL,
    [Time] [time](0) NOT NULL,
    [Last] [smallmoney] NULL,
    [Open] [smallmoney] NULL,
    [High] [smallmoney] NULL,
    [Low] [smallmoney] NULL,
    [Close] [smallmoney] NULL,
    [Volume] [bigint] NULL,
  CONSTRAINT [PK_Quote15MinuteHistoryTOS_rtd] PRIMARY KEY ([Symbol], [Date], [Time])
);

We have added the Time field to the primary key. Also, we have added the DateTime field to have an update time.

Let's configure formulas:

TOS Quotes - 15-minute formulas

The table contains the well-known formulas except for =Time15().

The =Time15() built-in function rounds the current time to 15 minutes up. As a result, we have 15-minute values in the Time field.

RTD.DB updates the record multiple times during 15-minute interval. However, a database contains the 15-minute values only.

You may use the built-in functions like =Time1(), =Time5(), =Time10(), =Time15(), =Time20() or =Time60() to get data with the required time interval.

Here is a well-known table configuration:

RealTimeTable configuration (3 tables)

Tick History Tables

You may also save every tick values to a database.

RTD.DB executes the INSERT commands only for such tables.

Let's create a table:

CREATE TABLE [rtd].[QuoteTickHistoryTOS](
    [ID] [bigint] IDENTITY(1,1) NOT NULL,
    [Symbol] [varchar](50) NULL,
    [DateTime] [datetime] NULL,
    [Date] [date] NULL,
    [Time] [time](0) NULL,
    [Last] [smallmoney] NULL,
    [Open] [smallmoney] NULL,
    [High] [smallmoney] NULL,
    [Low] [smallmoney] NULL,
    [Close] [smallmoney] NULL,
    [Volume] [bigint] NULL,
  CONSTRAINT [PK_QuoteTickHistoryTOS_rtd] PRIMARY KEY ([ID])
);

The primary key contains the identity column only.

Here is a formula configuration for the tick table:

TOS Quotes - tick history formulas

The configuration contains an additional row for the ID field with an empty formula. This is important.

Here is a table configuration:

RealTimeTable configuration (4 tables)

The configuration differs with the value in the IS_HISTORY field. 1 in this field forces using INSERT commands only.

Conclusion

We have learned how to configure four types of tables:

  • Tables of last values
  • Tables of end-of-day values
  • Intraday history tables
  • Tick tables

Of course, you may create such tables for stocks, options, and currencies, for any trading platform and supported database platform.

The RTD Database folder contains ready-to-use templates for several trading platforms that you may use as is or modify them to your needs.

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. 

Application Settings

You may change the application settings in the RTD.DB.exe.config and RTD.DB32.exe.config files.

RTD.DB loads application settings at the application start. So, you have to restart the application to reload settings.

Use the File, Open Configuration File menu item to open the file. You may edit the file using notepad.exe or another tool.

Use the File, Open Connection Manager menu item if you need to edit the connection strings only.

Configuration File Format

The configuration file can contain the appSettings and connectionStrings sections.

Configuration file example:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="AppCulture" value="en-US"/>
        <add key="AutoStart" value="true"/>
        <add key="ConnectionTimeout" value="5"/>
        <add key="CommandTimeout" value="5"/>
        <add key="InstanceName" value=""/>
        <add key="MinimizeToTray" value="true"/>
        <add key="RefreshTimerInterval" value="50"/>
        <add key="RefreshTaskInterval" value="0"/>
        <add key="ServersAsAdmin" value="TOS VFX"/>
        <add key="TwsUserName" value=""/>
        <add key="TosMaxUpdateRows" value="100"/>
        <add key="TosMinUpdateTime" value="10000"/>
        <add key="TosMaxUpdateTime" value="20000"/>
        <add key="tos.rtdMaxUpdateRows" value="100"/>
        <add key="tos.rtdMinUpdateTime" value="10000"/>
        <add key="tos.rtdMaxUpdateTime" value="20000"/>
        <add key="tos.rtdIsDynamicCalls" value="True"/>
        <!--<add key="NoDataLimit" value="20"/>-->
        <!--<add key="DataProcessor" value="DataProcessorCS.dll"/>-->
    </appSettings>
    <connectionStrings>
        <add name="rtd-mssql"
            connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=RTD;Integrated Security=True"
            providerName="System.Data.SqlClient" />
    </connectionStrings>
</configuration>

Configuration file settings:

AppCulture
This string value defines the application culture used for user interface translation.
AutoStart
This boolean value defines the immediate start of data updating after the program start.
Start the application with administrator privileges for updating data from DDE servers that require such privileges (TOS, VFX).
ConnectionTimeout
This integer value defines the server connection timeout in seconds.
CommandTimeout
This integer value defines the timeout of command execution in seconds.
InstanceName
This string value defines the instance name used to select table configurations using the RTD_INSTANCE_NAME field.
MinimizeToTray
This boolean value allows minimizing the application window in the system tray.
RefreshTimerInterval
This integer value defines the interval of data refreshing in milliseconds.
RefreshTimerInterval
This integer value defines the interval of checking changes in task tables specified in the LOAD_CODE field of the RealTimeTables table.
ServersAsAdmin
This string value defines RTD and DDE servers that require administrator privileges.
RTD.DB requests elevating for these servers.
TwsUserName
This string value defines a username for InteractiveBrokers Trader Workstation (TWS).
This name is used in real-time formulas like =S<TwsUserName> by default if the =S server is specified only.
<Server>MaxUpdateRows
This integer value defines a maximum number of active tickers connected to the server.
This option prevents server overhead. RTD.DB changes the tickers cyclically.
<Server>MinUpdateTime
This integer value defines a minimum number of milliseconds that a ticker must be connected to the server before it is replaced with a new one when the total number of tickers is more than MaxUpdateRows.
<Server>MaxUpdateTime
This integer value defines a maximum number of milliseconds that a ticker can be connected to the server before it is replaced with a new one when the total number of tickers is more than MaxUpdateRows.
<RTD Server>IsDynamicCalls
This boolean value defines a calling model for the RTD server: IRtdServer typed calls or dynamic calls.
thinkorswim thinkDesktop requires the dynamic model if Microsoft Excel is not installed.
NoDataLimit
This integer value defines the maximum number of refresh cycles without data refresh that starts reconnecting to a server.
Use this option if the server must return real-time data every time but may have issues.
DataProcessor
This string value defines an RTD.DB add-in used to preprocess data.
See RTD.DB Add-Ins.

Cycling Tickers

Usually, trading platforms have limitations for a number of refreshed tickers.

To update large numbers of tickers, RTD.DB cycles them.

You may specify the number of tickers in a group and required time to update a group (in milliseconds) in the application settings for every RTD or DDE server.

For example, here are settings for tos.rtd:

<add key="tos.rtdMaxUpdateRows" value="100"/>
<add key="tos.rtdMaxUpdateTime" value="20000"/>

and thinkorswim DDE:

<add key="tosMaxUpdateRows" value="100"/>
<add key="tosMaxUpdateTime" value="20000"/>

There are no "right" settings. You may experiment with them.

Pay attention to the platform stability, a number of pending rows, and database data quality.

The settings above are quite good for thinkorswim.

You may suggest the time required to update the required number of tickers.

For example, you plan to update 10,000 tickers (stock tickers or option codes).

RTD.DB updates 100 tickers every 20 seconds. I.e. 300 tickers per minute.

10,000 tickers / 300 tickers per minute = 33 minutes.

If you have a fast computer, disk, and a network, you may try to increase the number of tickers to 200 and decrease the update time to 10 seconds.

In this case, you decrease the total time to 33 / 2 / 2 ~ 8 minutes.

In any case, you have to understand that a lot of tickers requires a time to update. And these data are not real-time.

You may separate your ticker tables to have real-time data for smaller numbers of active tickers and end-of-day data for others.

User Interface

The RTD.DB main window looks like this:

RTD.DB Interface

You may find the application icon in the system tray also.

Menu File

Open Configuration File
Opens the RTD.DB.exe.config file. You may check or edit application settings.
Open Connection Manager
Opens Connection Manager to edit connection strings in visual mode.
Exit
Stops all the running services and closes the application.

Menu Operations

Start Services
Starts updating databases with real-time data.
Pause Services
Stops the timer that starts updating databases.
Use this button to stop updating temporarily. To start updating, click the Start button.
Stop Services
Stops all the running services.
Reload Database Data
Saves current data to databases and reloads data from databases.
Use this button to reload data when you add new tickers to database tables.
Save Data to Database
Saves current data to databases immediately.
Use this button, if the services have been paused, or you need to update the data before the next timer event.

Menu Help

Help
Displays the local help.
Online Help
Opens the online help web page.
Technical Support
Opens the support web page.
RTD.DB Website
Opens the product web page at the official website.
Register Product
Displays the Register Product wizard.
Buy License
Opens the web page to start purchasing.
Check Updates
Opens the web page to download updates.
About RTD.DB
Displays the About RTD.DB dialog box.

Table Columns

Status Image
The image indicates table status: green or red.
Table
The column displays database table name.
Rows
The column displays loaded row count.
Pending
The column displays a number of pending rows.
Last Topics
The column displays a number of topics that the real-time server returns on the last data refresh.
Last Notify
The column displays the time of the first data change notification from the real-time server after the last data refresh.
Last Refresh
The column displays the start time of the getting changed data from the real-time server.
The period between the notification and getting the changed data depends on the RefreshTimerInterval value.
Last Save
The column displays the time when the last data have been saved to a database.
The period between the notification and this time shows the maximum delay for real-time data in a database.
Status
The column displays the status of real-time server and database operations.
Topics
The column displays a number of topics connected to the real-time server.
Usually, this is the row count multiplied by real-time column count.
MSPR
The column displays average speed of saving data to a database in milliseconds per row (MSPR).
ProgID
The column displays RTD server ProgIDs or DDE service names.
Server
The column displays database servers.
Database
The column displays database names.

gConnectionManager

gConnectionManager allows editing connection strings in the configuration file in a visual mode:

gConnectionManager

You may also enable or disable the existing connection strings.

Click the "..." button to edit the connection string.

Select a database connection provider at the first step:

gConnectionManager - Selecting a database provider

Enter the information required to connect to a database:

gConnectionManager - Connecting to a database

The different database servers have specific features. Click the Help button or the Examples link to get the context help during the connecting.

The wizard tests the connection in the background and activates the Finish button if the connection succeeds.

If the Finish button is disabled, click the Test Connection button to test the connection.

Built-in Functions

The formula configuration table contains Excel-like formulas for getting data from RTD and DDE servers.

You may use built-in functions to update date and time fields if a server has no such fields.

For example:

TABLE_SCHEMATABLE_NAMECOLUMN_NAMERTD_FORMULA
rtdQuoteDayHistoryTOSSymbol
rtdQuoteDayHistoryTOSDate=Date()
rtdQuoteDayHistoryTOSTime=Time()
rtdQuoteDayHistoryTOSLast=TOS|LAST![Symbol]
rtdQuoteDayHistoryTOSChange=TOS|NET_CHANGE![Symbol]
rtdQuoteDayHistoryTOSBid=TOS|BID![Symbol]
rtdQuoteDayHistoryTOSAsk=TOS|ASK![Symbol]

Note that the current time is adjusted to the table time zone specified in the table configuration.

The second application of built-in formulas is getting aggregated time intervals like 15 minutes.

Just use the formulas like =DateTime15() or =Time15() to round up the current time.

Function List

FunctionResult
=TimeStamp()Returns the current UTC datetime.
=UtcNow()Returns the current UTC datetime.
=Now()Returns the current datetime.
=TableNow()Returns the current datetime adjusted to the table time zone.
=DateTime()Returns the last data update datetime.
=DateTime0()Returns the last data update datetime rounded to 1 second up.
=DateTime1()Returns the last data update datetime rounded to 1 minute up.
=DateTime5()Returns the last data update datetime rounded to 5 minutes up.
=DateTime10()Returns the last data update datetime rounded to 10 minutes up.
=DateTime15()Returns the last data update datetime rounded to 15 minutes up.
=DateTime20()Returns the last data update datetime rounded to 20 minutes up.
=DateTime60()Returns the last data update datetime rounded to 60 minutes up.
=Date()Returns the last data update date.
=Time()Returns the last data update time.
=Time0()Returns the last data update time rounded to 1 second up.
=Time1()Returns the last data update time rounded to 1 minute up.
=Time5()Returns the last data update time rounded to 5 minutes up.
=Time10()Returns the last data update time rounded to 10 minutes up.
=Time15()Returns the last data update time rounded to 15 minutes up.
=Time20()Returns the last data update time rounded to 20 minutes up.
=Time60()Returns the last data update time rounded to 60 minutes up.

Add-Ins

You may preprocess data before sending to a database using add-ins implemented with C++, C#, VB.NET or other languages.

This feature can be used for broadcasting data, for example.

The add-in must implement the IRDDataProcessor interface defined in IDataProcessor.dll:

void IRDDataProcessor.AppStart()
void IRDDataProcessor.AppStop()
bool IRDDataProcessor.ProcessRow(IRDDataRow data)

The ProcessRow method is called before saving data to a database.

The IRDDataRow has the following members:

string ServerName { get; }
string DatabaseName { get; }
string Table { get; }
string ProgID { get; }
object Item(string columnName) { get; set; }

The add-in can read the column data of the current row and change it using the Item property.

The data processor add-in must be attached in the configuration file.

For example:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="DataProcessor" value="RTDataBroadcastProcessor.dll"/>
  </appSettings>
</configuration>

You may find add-in examples implemented with C# and VB in the DataProcessor.zip file in the downloaded package.

Database Templates

As described in Concept, configuration steps include:

  1. Creating a database
  2. Creating data tables
  3. Creating ticker tables
  4. Creating configuration tables
  5. Configuring formulas
  6. Configuring data tables
  7. Configuring the connection string

You may find ready-to-use templates for several trading and database platform in the Database Templates folder of the download package.

Trading and analytical platforms include:

Supported database platforms include:

  • Microsoft SQL Server
  • Microsoft SQL Server Compact
  • Oracle Database
  • IBM DB2
  • MySQL and MariaDB
  • PostgreSQL
  • NuoDB

Use the following steps to configure a database using a template:

  1. Create a database on your target server if necessary.
  2. Select a folder of the target database platform like Microsoft SQL Server.
  3. Open, check, and execute the install.sql file to create configuration tables.
  4. Open the templates folder.
  5. Select a folder of the target trading platform like tos.rtd.
  6. Open, check, and execute files like QuoteListTOS.sql and OptionListTOS.sql to create ticker tables.
  7. Add tickers to the newly created tables like QuoteListTOS and OptionListTOS.
  8. Open, check, and execute files like QuoteDayHistoryTOS.sql or Option15MinuteHistoryTOS.sql to create data tables and configure formulas.
  9. Configure the connection string using Connection Manager or the application settings directly.

You may add other tables (step 8) later.

Every file used to create a data table like Option15MinuteHistoryTOS.sql has the following structure:

  1. The data table CREATE TABLE statement
  2. One row of RealTimeTables configuration
  3. Multiple rows of RealTimeFormulas configuration

You may use such files as templates for other tables.

For example, you may use the Option15MinuteHistoryTOS.sql file to create the Option10MinuteHistoryTOS table.
Just copy the file and use Search and Replace to change the table name.

Troubleshooting

The RTD.DB window has two main parts: a table monitor and a log text box.

RTD.DB Interface

The table monitor shows actual status for each updated table. See column meanings in the User Interface topic.

The log shows diagnostic and error messages.

Normally, you should see the following messages in the log:

  1. Connection ... added
  2. Database ... loaded
  3. Object ... has been created
  4. Server ... start status: 1
  5. Table ... added
  6. Table ... loaded

Here are possible issues and solutions:

If you do not see the Connection ... added message
Click File, Open Connection Manager and test your connections.
If you do not see the Database ... loaded message
Check that your database has two required configuration tables.
If you do not see the Object ... has been created message
Check your formulas in the RealTimeFomulas table.
The formulas must use the same RTD or DDE server name as in regular Microsoft Excel formulas.
For example, tos.rtd or esrtd.
If you work with Trader Workstation, specify TwsUserName in the application settings.
Also, try to run the instance with another bitness. For example, RTD.DB32.exe if you started RTD.DB.exe before.
If you have no Microsoft Excel installed, try to change the IsDynamicCalls setting in the application settings.
If you do not see the Server ... start status: 1 message
Check that you have started the trading platform. It is required.
If this is not a case, try to run the instance with another bitness. For example, RTD.DB32.exe if you started RTD.DB.exe before.
If you do not see the Table ... added message
Check the configuration in the RealTimeTables.
It must contain the valid schema, name, and load code.
If you do not see the Table ... loaded message
Check the configuration in the RealTimeTables.
It must contain the valid schema, name, and load code.

Normally, you should see non-empty values in the following columns:

  1. Rows
  2. Topics
  3. Last Notify
  4. Last Save
  5. Status

Here are possible issues and solutions: 

If you see empty rows
Check the LOAD_CODE value in the RealTimeTables table.
Check that your ticker table contains tickers.
If you see empty topics
Check the formulas in the RealTimeFormulas table.
For example, you may have the difference in a table schema or name.
Also, specified RTD or DDE formulas may be invalid.
If you see empty Last Notify
This happens when the RTD or DDE server does not respond.
Check that the server is alive.
If you see empty Last Save
Check that the RealTimeFormulas table contains primary key fields.
If you see an error message in the Status column
Read the message. It should explain the reason.

Here are possible issues and solutions for database data: 

If you see empty columns or columns with wrong values
This is correct if you do not specify a column formula in the RealTimeFormulas table or disable the column update.
If the formulas are okay, try to set the English (United States) regional settings in the Windows Control Panel.
If this helps, please contact us to fix detecting settings.

Product Registration

RTD.DB requires registration to start a trial and to use it after the trial period.

To register, open Help, Register Product.
Also, you may open Start Menu, All Programs, RTD.DB, Register Product.

Selecting Edition

You may register the trial version or the RTD.DB Free edition for free, the product code is not required.

To register the RTD.DB Personal, Standard, or Enterprise edition fill in the product code received after purchasing.

RTD.DB Registration - Select the edition

Licensee Data

Please fill in the registration form like this:

RTD.DB Registration - Fill personal data

The Next button is enabled when all the required fields are filled.

Don't forget to check the required field about the personal data use.

Online Registration

This step allows you to check your email address. If the email is valid, click Next.

You may return to the previous step using the Back button.

RTD.DB Registration - Check the email

After clicking the Next button, the RTD.DB connects to the registration server.

If the connection is successful, the final step screen is shown.

If any error occurred during connection, you might try to register the product later or try to register the product by email.

RTD.DB Registration - The final step

You may set the registration for all users of the computer. This action requires administrator privileges.

Click Finish.

Registration by Email

If you choose the Register by email option on the Licensee Data step, the following screen is displayed:

RTD.DB Registration - Check and start the registration email

The Next button starts the default email program, creates a registration email, and activates the next step.
Don't forget to send the email.

If starting of the email program has failed, you may create the registration email manually using the shown registration data.
Please carefully copy the To, Subject, and the Message fields.

The registration server sends the reply in a couple of seconds; but you may close the dialog box and open it again, in the same step.

Please copy the activation code from the received registration email and paste it into the Activation code field.

RTD.DB Registration - Paste the activation code

The Next button is enabled when the activation code is valid.

Click Next to continue.

The wizard checks the registration data and confirms the registration.

RTD.DB Registration - The final step

You may set the registration for all users of the computer. This action requires administrator privileges.

Click Finish.