Quotes from IB Trader Workstation (TWS)
Overview
The RTD database contains preconfigured tables for getting real-time data from InteractiveBrokers Trader Workstation (TWS).
Quote tables are designed for getting data for stocks, futures, and currency pairs. Use option tables for options.
The data are updated from the DDE server.
You can disable unusable columns to reduce the server overhead.
The DDE server does not contain an actual data time field.
The DateTime, Date, and Time fields are updated using the PC time adjusted to the table time zone (Eastern Standard Time).
Real-Time Data Tables
Table Configurations
Microsoft SQL Server and Microsoft SQL Server Compact:
TABLE_SCHEMA | TABLE_NAME | LOAD_CODE | IS_HISTORY |
---|---|---|---|
rtd | QuoteListTWS | ||
rtd | QuotesTWS | SELECT TickId, Code AS Symbol FROM rtd.QuoteListTWS WHERE Code NOT LIKE '%_OPT_20%' | |
rtd | QuoteDayHistoryTWS | SELECT TickId, Code AS Symbol FROM rtd.QuoteListTWS WHERE Code NOT LIKE '%_OPT_20%' | |
rtd | QuoteTickHistoryTWS | SELECT TickId, Code AS Symbol FROM rtd.QuoteListTWS WHERE Code NOT LIKE '%_OPT_20%' | 1 |
MySQL, MariaDB, and PostgreSQL:
TABLE_SCHEMA | TABLE_NAME | LOAD_CODE | IS_HISTORY |
---|---|---|---|
rtd | quote_list_tws | ||
rtd | quotes_tws | SELECT TICK_ID, CODE AS SYMBOL FROM rtd.quote_list_tws WHERE CODE NOT LIKE '%_OPT_20%' | |
rtd | quote_day_history_tws | SELECT TICK_ID, CODE AS SYMBOL FROM rtd.quote_list_tws WHERE CODE NOT LIKE '%_OPT_20%' | |
rtd | quote_tick_history_tws | SELECT TICK_ID, CODE AS SYMBOL FROM rtd.quote_list_tws WHERE CODE NOT LIKE '%_OPT_20%' | 1 |
Oracle Database, IBM DB2, and NuoDB:
TABLE_SCHEMA | TABLE_NAME | LOAD_CODE | IS_HISTORY |
---|---|---|---|
RTD | QUOTE_LIST_TWS | ||
RTD | QUOTES_TWS | SELECT TICK_ID, CODE AS SYMBOL FROM RTD.QUOTE_LIST_TWS WHERE CODE NOT LIKE '%_OPT_20%' | |
RTD | QUOTE_DAY_HISTORY_TWS | SELECT TICK_ID, CODE AS SYMBOL FROM RTD.QUOTE_LIST_TWS WHERE CODE NOT LIKE '%_OPT_20%' | |
RTD | QUOTE_TICK_HISTORY_TWS | SELECT TICK_ID, CODE AS SYMBOL FROM RTD.QUOTE_LIST_TWS WHERE CODE NOT LIKE '%_OPT_20%' | 1 |
* Click on the table name to go to the table description.
Task Table Examples
rtd.QuoteListTWS for Microsoft SQL Server and Microsoft SQL Server Compact:
TickId | Code |
---|---|
1 | AAPL |
2 | GOOG |
8 | AAPL_OPT_20150116_500_C_100_SMART_USD_~ |
9 | AAPL_OPT_20150116_600_C_100_SMART_USD_~ |
rtd.quote_list_tws for MySQL, MariaDB, Oracle Database, IBM DB2, NuoDB, and PostgreSQL:
TICK_ID | CODE |
---|---|
1 | AAPL |
2 | GOOG |
8 | AAPL_OPT_20150116_500_C_100_SMART_USD_~ |
9 | AAPL_OPT_20150116_600_C_100_SMART_USD_~ |
The task table contains tickers for quote and option tables as the TWS DDE server requires ticker registration using the TickId field.
Accordingly, quote table tasks select not option tickers only.
Primary Key Columns
Microsoft SQL Server and Microsoft SQL Server Compact:
TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | RTD_FORMULA | COMMENT |
---|---|---|---|---|
rtd | QuotesTWS | Req | =S|tik!'id[TickId]?req?[Symbol]_STK_SMART_USD_~' | Formula |
rtd | QuotesTWS | TickId | Formula | |
rtd | QuotesTWS | Symbol | PK | |
rtd | QuoteDayHistoryTWS | ID | Formula | |
rtd | QuoteDayHistoryTWS | Req | =S|tik!'id[TickId]?req?[Symbol]_STK_SMART_USD_~' | Formula |
rtd | QuoteDayHistoryTWS | TickId | Formula | |
rtd | QuoteDayHistoryTWS | Symbol | PK | |
rtd | QuoteDayHistoryTWS | Date | =Date() | PK |
rtd | QuoteTickHistoryTWS | Req | =S|tik!'id[TickId]?req?[Symbol]_STK_SMART_USD_~' | Formula |
rtd | QuoteTickHistoryTWS | TickId | Formula | |
rtd | QuoteTickHistoryTWS | ID | PK, IDENTITY |
MySQL, MariaDB, and PostgreSQL:
TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | RTD_FORMULA | COMMENT |
---|---|---|---|---|
rtd | quotes_tws | REQ | =S|tik!'id[TICK_ID]?req?[SYMBOL]_STK_SMART_USD_~' | Formula |
rtd | quotes_tws | TICK_ID | Formula | |
rtd | quotes_tws | SYMBOL | PK | |
rtd | quote_day_history_tws | ID | Formula | |
rtd | quote_day_history_tws | REQ | =S|tik!'id[TICK_ID]?req?[SYMBOL]_STK_SMART_USD_~' | Formula |
rtd | quote_day_history_tws | TICK_ID | Formula | |
rtd | quote_day_history_tws | SYMBOL | PK | |
rtd | quote_day_history_tws | DATE | =Date() | PK |
rtd | quote_tick_history_tws | REQ | =S|tik!'id[TICK_ID]?req?[SYMBOL]_STK_SMART_USD_~' | Formula |
rtd | quote_tick_history_tws | TICK_ID | Formula | |
rtd | quote_tick_history_tws | ID | PK, IDENTITY |
Oracle Database, IBM DB2, and NuoDB:
TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | RTD_FORMULA | COMMENT |
---|---|---|---|---|
RTD | QUOTES_TWS | REQ | =S|tik!'id[TICK_ID]?req?[SYMBOL]_STK_SMART_USD_~' | Formula |
RTD | QUOTES_TWS | TICK_ID | Formula | |
RTD | QUOTES_TWS | SYMBOL | PK | |
RTD | QUOTE_DAY_HISTORY_TWS | ID | Formula | |
RTD | QUOTE_DAY_HISTORY_TWS | REQ | =S|tik!'id[TICK_ID]?req?[SYMBOL]_STK_SMART_USD_~' | Formula |
RTD | QUOTE_DAY_HISTORY_TWS | TICK_ID | Formula | |
RTD | QUOTE_DAY_HISTORY_TWS | SYMBOL | PK | |
RTD | QUOTE_DAY_HISTORY_TWS | DATE | =Date() | PK |
RTD | QUOTE_TICK_HISTORY_TWS | REQ | =S|tik!'id[TICK_ID]?req?[SYMBOL]_STK_SMART_USD_~' | Formula |
RTD | QUOTE_TICK_HISTORY_TWS | TICK_ID | Formula | |
RTD | QUOTE_TICK_HISTORY_TWS | ID | PK, IDENTITY |
Real-Time Formulas for Microsoft SQL Server and Microsoft SQL Server Compact
rtd.QuotesTWS
The table contains the last data values of stocks, futures, and currency pairs from InteractiveBrokers Trader Workstation (TWS).
COLUMN_NAME | RTD_FORMULA | COMMENT |
---|---|---|
Req | =S|tik!'id[TickId]?req?[Symbol]_STK_SMART_USD_~' | Formula |
TickId | Formula | |
Symbol | PK | |
DateTime | =DateTime() | |
Date | =Date() | |
Time | =Time() | |
Last | =S|tik!id[TickId]?last | |
LastSize | =S|tik!id[TickId]?lastSize | |
Bid | =S|tik!id[TickId]?bid | |
Ask | =S|tik!id[TickId]?ask | |
BidSize | =S|tik!id[TickId]?bidSize | |
AskSize | =S|tik!id[TickId]?askSize | |
High | =S|tik!id[TickId]?high | |
Low | =S|tik!id[TickId]?low | |
Close | =S|tik!id[TickId]?close | |
Volume | =S|tik!id[TickId]?volume | |
LastUpdateTimeStamp |
rtd.QuoteDayHistoryTWS
The table contains day data history of stocks, futures, and currency pairs from InteractiveBrokers Trader Workstation (TWS).
COLUMN_NAME | RTD_FORMULA | COMMENT |
---|---|---|
ID | Formula | |
Req | =S|tik!'id[TickId]?req?[Symbol]_STK_SMART_USD_~' | Formula |
TickId | Formula | |
Symbol | PK | |
Date | =Date() | PK |
Time | =Time() | |
Last | =S|tik!id[TickId]?last | |
LastSize | =S|tik!id[TickId]?lastSize | |
Bid | =S|tik!id[TickId]?bid | |
Ask | =S|tik!id[TickId]?ask | |
BidSize | =S|tik!id[TickId]?bidSize | |
AskSize | =S|tik!id[TickId]?askSize | |
High | =S|tik!id[TickId]?high | |
Low | =S|tik!id[TickId]?low | |
Close | =S|tik!id[TickId]?close | |
Volume | =S|tik!id[TickId]?volume | |
LastUpdateTimeStamp |
rtd.QuoteTickHistoryTWS
The table contains tick data history of stocks, futures, and currency pairs from InteractiveBrokers Trader Workstation (TWS).
COLUMN_NAME | RTD_FORMULA | COMMENT |
---|---|---|
Req | =S|tik!'id[TickId]?req?[Symbol]_STK_SMART_USD_~' | Formula |
TickId | Formula | |
ID | PK, IDENTITY | |
Symbol | ||
DateTime | =DateTime() | |
Date | =Date() | |
Time | =Time() | |
Last | =S|tik!id[TickId]?last | |
LastSize | =S|tik!id[TickId]?lastSize | |
Bid | =S|tik!id[TickId]?bid | |
Ask | =S|tik!id[TickId]?ask | |
BidSize | =S|tik!id[TickId]?bidSize | |
AskSize | =S|tik!id[TickId]?askSize | |
High | =S|tik!id[TickId]?high | |
Low | =S|tik!id[TickId]?low | |
Close | =S|tik!id[TickId]?close | |
Volume | =S|tik!id[TickId]?volume |
Real-Time Formulas for MySQL, MariaDB, Oracle Database, IBM DB2, NuoDB, and PostgreSQL
rtd.quotes_tws
The table contains the last data values of stocks, futures, and currency pairs from InteractiveBroker Trader Workstation (TWS).
COLUMN_NAME | RTD_FORMULA | COMMENT |
---|---|---|
REQ | =S|tik!'id[TICK_ID]?req?[SYMBOL]_STK_SMART_USD_~' | Formula |
TICK_ID | Formula | |
SYMBOL | PK | |
DATETIME | =DateTime() | |
DATE | =Date() | |
TIME | =Time() | |
LAST | =S|tik!id[TICK_ID]?last | |
LAST_SIZE | =S|tik!id[TICK_ID]?lastSize | |
BID | =S|tik!id[TICK_ID]?bid | |
ASK | =S|tik!id[TICK_ID]?ask | |
BID_SIZE | =S|tik!id[TICK_ID]?bidSize | |
ASK_SIZE | =S|tik!id[TICK_ID]?askSize | |
HIGH | =S|tik!id[TICK_ID]?high | |
LOW | =S|tik!id[TICK_ID]?low | |
CLOSE | =S|tik!id[TICK_ID]?close | |
VOLUME | =S|tik!id[TICK_ID]?volume | |
LAST_UPDATE_TIMESTAMP |
rtd.quote_day_history_tws
The table contains day data history of stocks, futures, and currency pairs from InteractiveBroker TraderWorkStation (TWS).
COLUMN_NAME | RTD_FORMULA | COMMENT |
---|---|---|
ID | Formula | |
REQ | =S|tik!'id[TICK_ID]?req?[SYMBOL]_STK_SMART_USD_~' | Formula |
TICK_ID | Formula | |
SYMBOL | PK | |
DATE | =Date() | PK |
TIME | =Time() | |
LAST | =S|tik!id[TICK_ID]?last | |
LAST_SIZE | =S|tik!id[TICK_ID]?lastSize | |
BID | =S|tik!id[TICK_ID]?bid | |
ASK | =S|tik!id[TICK_ID]?ask | |
BID_SIZE | =S|tik!id[TICK_ID]?bidSize | |
ASK_SIZE | =S|tik!id[TICK_ID]?askSize | |
HIGH | =S|tik!id[TICK_ID]?high | |
LOW | =S|tik!id[TICK_ID]?low | |
CLOSE | =S|tik!id[TICK_ID]?close | |
VOLUME | =S|tik!id[TICK_ID]?volume | |
LAST_UPDATE_TIMESTAMP |
rtd.quote_tick_history_tws
The table contains tick data history of stocks, futures, and currency pairs from InteractiveBroker TraderWorkStation (TWS).
COLUMN_NAME | RTD_FORMULA | COMMENT |
---|---|---|
REQ | =S|tik!'id[TICK_ID]?req?[SYMBOL]_STK_SMART_USD_~' | Formula |
TICK_ID | Formula | |
ID | PK, IDENTITY | |
SYMBOL | ||
DATETIME | =DateTime() | |
DATE | =Date() | |
TIME | =Time() | |
LAST | =S|tik!id[TICK_ID]?last | |
LAST_SIZE | =S|tik!id[TICK_ID]?lastSize | |
BID | =S|tik!id[TICK_ID]?bid | |
ASK | =S|tik!id[TICK_ID]?ask | |
BID_SIZE | =S|tik!id[TICK_ID]?bidSize | |
ASK_SIZE | =S|tik!id[TICK_ID]?askSize | |
HIGH | =S|tik!id[TICK_ID]?high | |
LOW | =S|tik!id[TICK_ID]?low | |
CLOSE | =S|tik!id[TICK_ID]?close | |
VOLUME | =S|tik!id[TICK_ID]?volume |