RTD Database
Overview
The RTD database is a ready-to-use solution for getting real-time data from preconfigured data providers using RealTimeToDB.
You can use the database as is, customize it, or use the source code to create required tables in your databases.
Preconfigured real-time data providers:
- eSignal FutureSource (ES)
- Interactive Brokers Trader Workstation (TWS)
- Thinkorswim thinkDesktop (TOS)
- VertexFX Trader (VFX)
- Yahoo! Finance, Google Finance, and MSN Money through RealTimeToExcel
Supported database servers:
- Microsoft SQL Server.
- Microsoft SQL Server Compact.
- SkySQL MariaDB.
- Oracle MySQL.
- Oracle Database.
- IBM DB2.
- NuoDB.
You can find the installation code and instructions in the RTD Database folder of the setup package.
The RTD database also contains preconfigured views for getting real-time data from database tables into Microsoft Excel using companion products RealTimeToExcel and the SaveToDB add-in for Microsoft Excel.
The SaveToDB add-in can also be used for editing configuration tables in Microsoft Excel. So you do not need any installed database client to manage and use the database.
Preinstalled Local Database
The local RTD database for Microsoft SQL Server Compact is installed by default into the %LOCALAPPDATA%\Gartle\RealTimeToDB folder.
You can start loading real-time data into your database and using the real-time data in Microsoft Excel in a couple of minutes.
The source copy of the rtd.sdf database is also located in Resources subdirectory. You can use this copy to restore the database to the initial state.
Installing and Uninstalling
The RTD Database folder of the setup package contains the subfolders with the source code and instructions for every supported database server.
Installation is an easy process: edit the connection properties and run the setup batch file.
The database must have two users:
- A user to update database tables using RealTimeToDB. The default name is rtd.
- A test user to get the data from the database into Microsoft Excel using RealTimeToExcel. The default name is rtdxls.
These names are used in preconfigured Excel workbooks and configuration files.
Configuration Tables
SQL Server and SQL Server Compact | MySQL and MariaDB | Oracle Database, IBM DB2, and NuoDB |
---|---|---|
RealTimeTables | real_time_tables | REAL_TIME_TABLES |
RealTimeFormulas | real_time_formulas | REAL_TIME_FORMULAS |
The RealTimeTables table contains table configurations in line with RealTimeToDB requirements.
Change the IS_DISABLED field to manage updating data tables.
Change the LOAD_CODE field to manage tickers to update.
The RealTimeFormulas table configures Excel-like formulas used to get data from RTD and DDE servers.
See formulas in data table descriptions.
You can use the following Excel workbooks included in the setup package to manage tables using Microsoft Excel with the SaveToDB add-in installed:
- rtd-mssql.xlsx
- rtd-sqlce.xlsx
- rtd-mysql.xlsx
- rtd-ora.xlsx
- rtd-db2.xlsx
- rtd-nuodb.xlsx
Data Tables
Data tables can be viewed from several perspectives.
Tables by data providers:
- eSignal FutureSource (ES)
- Interactive Brokers Trader Workstation (TWS)
- Thinkorswim thinkDesktop (TOS)
- VertexFX Trader (VFX)
- Yahoo! Finance through RealTimeToExcel (Yahoo)
- Google Finance through RealTimeToExcel (Google)
- MSN Money through RealTimeToExcel (MsnMoney)
Tables by stored data:
- Fundamentals (fundamental data from Yahoo! Finance).
- Stocks (static data from Yahoo! Finance).
- Quotes (stocks, futures, and currency pairs).
- Options.
Tables by time frame:
- Last values.
- Day history.
- Time history.
- Tick history.
Last value tables have one column primary keys, Symbol or Code.
Day history tables have two column primary keys, Symbol or Code and Date.
Time history tables have two column primary keys, Symbol or Code and DateTime.
You can change the time frame for such tables: 1 second (default), 1 minute, 5, 10, 15, 20, 30, and 60 minutes.
To change the time frame, modify used functions in the column formulas.
The time interval depends on a real-time data provider also.
Tick history tables contain all records from the real-time data provider. RealTimeToDB uses only INSERT statements for such tables.
The tick history tables must have an auto-increment primary key column.
You can click on any table above to go to the table description.
Task Tables
SQL Server and SQL Server Compact | MySQL and MariaDB | Oracle Database, IBM DB2, and NuoDB |
---|---|---|
QuoteListStocks | quote_list_stocks | QUOTE_LIST_STOCKS |
QuoteListYahoo | option_list_yahoo | OPTION_LIST_YAHOO |
QuoteListMsnMoney | option_list_msnmoney | OPTION_LIST_MSNMONEY |
QuoteListES | quote_list_es | QUOTE_LIST_ES |
QuoteListTOS | quote_list_tos | QUOTE_LIST_TOS |
QuoteListTWS | quote_list_tws | QUOTE_LIST_TWS |
QuoteListVFX | quote_list_vfx | QUOTE_LIST_VFX |
OptionListTOS | option_list_tos | OPTION_LIST_TOS |
OptionListYahoo | option_list_yahoo | OPTION_LIST_YAHOO |
OptionListGoogle | option_list_google | OPTION_LIST_GOOGLE |
OptionListMsnMoney | option_list_msnmoney | OPTION_LIST_MSNMONEY |
CurrenciesListYahoo | currencies_list_yahoo | CURRENCIES_LIST_YAHOO |
CurrenciesListMsnMoney | currencies_list_msnmoney | CURRENCIES_LIST_MSNMONEY |
Task tables contain tickers to update.
It is the simplest solution. You can delete all tickers and insert required ones. You can use Microsoft Excel workbooks like rtd-sqlce.xlsx or SQL statements to update task tables.
Another solution to specify tickers to update is to change the LOAD_CODE in the RealTimeTables table.
You can use SELECT UNION to combine tickers from several tables that require real-time data.
Don't forget to reload the configuration in RealTimeToDB after changes.
Views for Microsoft Excel for Refreshing Data in Real-Time
You can load database data into Microsoft Excel using native Excel features.
You can configure data auto-refresh to reload all table data.
However, you have a better way. You can use RealTimeToExcel, a companion product, to refresh the data using the Excel RTD functions with the lowest overhead.
The views shown below contain ready Excel formulas to get data from database tables in real-time.
Also, the SaveToDB add-in converts such text database formulas into real Excel ones. So, you easily connect to any table and get the real-time data immediately.
You can use preconfigured Excel workbooks from the setup package to get the data from views:
- rtdxls-mssql.xlsx
- rtdxls-sqlce.xlsx
- rtdxls-mysql.xlsx
- rtdxls-ora.xlsx
- rtdxls-db2.xlsx
- rtdxls-nuodb.xlsx
See Real-Time Views for Microsoft Excel for details.