Quotes from IB Trader Workstation (TWS)

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_SCHEMATABLE_NAMELOAD_CODEIS_HISTORY
rtdQuoteListTWS
rtdQuotesTWSSELECT TickId, Code AS Symbol FROM rtd.QuoteListTWS WHERE Code NOT LIKE '%_OPT_20%'
rtdQuoteDayHistoryTWSSELECT TickId, Code AS Symbol FROM rtd.QuoteListTWS WHERE Code NOT LIKE '%_OPT_20%'
rtdQuoteTickHistoryTWSSELECT TickId, Code AS Symbol FROM rtd.QuoteListTWS WHERE Code NOT LIKE '%_OPT_20%'1

MySQL, MariaDB, and PostgreSQL:

TABLE_SCHEMATABLE_NAMELOAD_CODEIS_HISTORY
rtdquote_list_tws
rtdquotes_twsSELECT TICK_ID, CODE AS SYMBOL FROM rtd.quote_list_tws WHERE CODE NOT LIKE '%_OPT_20%'
rtdquote_day_history_twsSELECT TICK_ID, CODE AS SYMBOL FROM rtd.quote_list_tws WHERE CODE NOT LIKE '%_OPT_20%'
rtdquote_tick_history_twsSELECT TICK_ID, CODE AS SYMBOL FROM rtd.quote_list_tws WHERE CODE NOT LIKE '%_OPT_20%'1

Oracle Database, IBM DB2, and NuoDB:

TABLE_SCHEMATABLE_NAMELOAD_CODEIS_HISTORY
RTDQUOTE_LIST_TWS
RTDQUOTES_TWSSELECT TICK_ID, CODE AS SYMBOL FROM RTD.QUOTE_LIST_TWS WHERE CODE NOT LIKE '%_OPT_20%'
RTDQUOTE_DAY_HISTORY_TWSSELECT TICK_ID, CODE AS SYMBOL FROM RTD.QUOTE_LIST_TWS WHERE CODE NOT LIKE '%_OPT_20%'
RTDQUOTE_TICK_HISTORY_TWSSELECT 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:

TickIdCode
1AAPL
2GOOG
8AAPL_OPT_20150116_500_C_100_SMART_USD_~
9AAPL_OPT_20150116_600_C_100_SMART_USD_~

rtd.quote_list_tws for MySQL, MariaDB, Oracle Database, IBM DB2, NuoDB, and PostgreSQL:

TICK_IDCODE
1AAPL
2GOOG
8AAPL_OPT_20150116_500_C_100_SMART_USD_~
9AAPL_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_SCHEMATABLE_NAMECOLUMN_NAMERTD_FORMULACOMMENT
rtdQuotesTWSReq=S|tik!'id[TickId]?req?[Symbol]_STK_SMART_USD_~'Formula
rtdQuotesTWSTickIdFormula
rtdQuotesTWSSymbolPK
rtdQuoteDayHistoryTWSIDFormula
rtdQuoteDayHistoryTWSReq=S|tik!'id[TickId]?req?[Symbol]_STK_SMART_USD_~'Formula
rtdQuoteDayHistoryTWSTickIdFormula
rtdQuoteDayHistoryTWSSymbolPK
rtdQuoteDayHistoryTWSDate=Date()PK
rtdQuoteTickHistoryTWSReq=S|tik!'id[TickId]?req?[Symbol]_STK_SMART_USD_~'Formula
rtdQuoteTickHistoryTWSTickIdFormula
rtdQuoteTickHistoryTWSIDPK, IDENTITY

MySQL, MariaDB, and PostgreSQL:

TABLE_SCHEMATABLE_NAMECOLUMN_NAMERTD_FORMULACOMMENT
rtdquotes_twsREQ=S|tik!'id[TICK_ID]?req?[SYMBOL]_STK_SMART_USD_~'Formula
rtdquotes_twsTICK_IDFormula
rtdquotes_twsSYMBOLPK
rtdquote_day_history_twsIDFormula
rtdquote_day_history_twsREQ=S|tik!'id[TICK_ID]?req?[SYMBOL]_STK_SMART_USD_~'Formula
rtdquote_day_history_twsTICK_IDFormula
rtdquote_day_history_twsSYMBOLPK
rtdquote_day_history_twsDATE=Date()PK
rtdquote_tick_history_twsREQ=S|tik!'id[TICK_ID]?req?[SYMBOL]_STK_SMART_USD_~'Formula
rtdquote_tick_history_twsTICK_IDFormula
rtdquote_tick_history_twsIDPK, IDENTITY

Oracle Database, IBM DB2, and NuoDB:

TABLE_SCHEMATABLE_NAMECOLUMN_NAMERTD_FORMULACOMMENT
RTDQUOTES_TWSREQ=S|tik!'id[TICK_ID]?req?[SYMBOL]_STK_SMART_USD_~'Formula
RTDQUOTES_TWSTICK_IDFormula
RTDQUOTES_TWSSYMBOLPK
RTDQUOTE_DAY_HISTORY_TWSIDFormula
RTDQUOTE_DAY_HISTORY_TWSREQ=S|tik!'id[TICK_ID]?req?[SYMBOL]_STK_SMART_USD_~'Formula
RTDQUOTE_DAY_HISTORY_TWSTICK_IDFormula
RTDQUOTE_DAY_HISTORY_TWSSYMBOLPK
RTDQUOTE_DAY_HISTORY_TWSDATE=Date()PK
RTDQUOTE_TICK_HISTORY_TWSREQ=S|tik!'id[TICK_ID]?req?[SYMBOL]_STK_SMART_USD_~'Formula
RTDQUOTE_TICK_HISTORY_TWSTICK_IDFormula
RTDQUOTE_TICK_HISTORY_TWSIDPK, 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_NAMERTD_FORMULACOMMENT
Req=S|tik!'id[TickId]?req?[Symbol]_STK_SMART_USD_~'Formula
TickIdFormula
SymbolPK
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_NAMERTD_FORMULACOMMENT
IDFormula
Req=S|tik!'id[TickId]?req?[Symbol]_STK_SMART_USD_~'Formula
TickIdFormula
SymbolPK
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_NAMERTD_FORMULACOMMENT
Req=S|tik!'id[TickId]?req?[Symbol]_STK_SMART_USD_~'Formula
TickIdFormula
IDPK, 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_NAMERTD_FORMULACOMMENT
REQ=S|tik!'id[TICK_ID]?req?[SYMBOL]_STK_SMART_USD_~'Formula
TICK_IDFormula
SYMBOLPK
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_NAMERTD_FORMULACOMMENT
IDFormula
REQ=S|tik!'id[TICK_ID]?req?[SYMBOL]_STK_SMART_USD_~'Formula
TICK_IDFormula
SYMBOLPK
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_NAMERTD_FORMULACOMMENT
REQ=S|tik!'id[TICK_ID]?req?[SYMBOL]_STK_SMART_USD_~'Formula
TICK_IDFormula
IDPK, 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