Access Thinkorswim Option Data with TOS.RTD

Access Thinkorswim Option Data with TOS.RTD

Overview

The RTD database includes predefined tables for retrieving real-time data from thinkorswim desktop.

Use option tables to access data for options. For stocks, futures, and currency pairs, utilize the quote tables.

RTD formulas are preferred over DDE formulas. However, be aware that thinkorswim desktop may crash when requesting more than 200,000 topics.

RTD formulas can be converted to DDE using the patches from the database template folders.

Disable unnecessary columns to minimize server overhead.

The RTD server does not provide an actual data timestamp.
The datetime, date, and time fields are updated using local system time adjusted to the table's configured time zone (Eastern Standard Time).

Real-Time Data Tables

Table Configurations

table_schematable_nameload_codeis_history
rtdtos_option_list
rtdtos_last_option_dataSELECT code FROM rtd.tos_option_list
rtdtos_historical_option_dataSELECT code FROM rtd.tos_option_list
rtdtos_option_data_ticksSELECT code FROM rtd.tos_option_list1

Task Table Examples

tos_option_list:

code
.AAPL260116C200
.AAPL260116C300
.AAPL260116P200
.AAPL260116P300

Primary Key Columns

table_schematable_namecolumn_namertd_formulacomment
rtdtos_last_option_datacodePK
rtdtos_historical_option_datacodePK
rtdtos_historical_option_datadate=Date()PK
rtdtos_option_data_ticksidPK, IDENTITY

Real-Time Data Formulas

tos_last_option_data

This table contains the most recent values of option data from thinkorswim desktop.

column_namertd_formulacomment
codePK
datetime=DateTime()
date=Date()
time=Time()
description=RTD("tos.rtd",,"DESCRIPTION",[code])
last=RTD("tos.rtd",,"LAST",[code])
change=RTD("tos.rtd",,"NET_CHANGE",[code])
percent_change=RTD("tos.rtd",,"PERCENT_CHANGE",[code])
last_size=RTD("tos.rtd",,"LAST_SIZE",[code])
last_x=RTD("tos.rtd",,"LX",[code])
mark=RTD("tos.rtd",,"MARK",[code])
mark_change=RTD("tos.rtd",,"MARK_CHANGE",[code])
mark_percent_change=RTD("tos.rtd",,"MARK_PERCENT_CHANGE",[code])
bid=RTD("tos.rtd",,"BID",[code])
ask=RTD("tos.rtd",,"ASK",[code])
bid_size=RTD("tos.rtd",,"BID_SIZE",[code])
ask_size=RTD("tos.rtd",,"ASK_SIZE",[code])
bid_ask_size=RTD("tos.rtd",,"BA_SIZE",[code])
bid_x=RTD("tos.rtd",,"BX",[code])
ask_x=RTD("tos.rtd",,"AX",[code])
open=RTD("tos.rtd",,"OPEN",[code])
high=RTD("tos.rtd",,"HIGH",[code])
low=RTD("tos.rtd",,"LOW",[code])
close=RTD("tos.rtd",,"CLOSE",[code])
volume=RTD("tos.rtd",,"VOLUME",[code])
open_int=RTD("tos.rtd",,"OPEN_INT",[code])
implied_vol=RTD("tos.rtd",,"IMPL_VOL",[code])
delta=RTD("tos.rtd",,"DELTA",[code])
gamma=RTD("tos.rtd",,"GAMMA",[code])
theta=RTD("tos.rtd",,"THETA",[code])
vega=RTD("tos.rtd",,"VEGA",[code])
rho=RTD("tos.rtd",,"RHO",[code])
extrinsic=RTD("tos.rtd",,"EXTRINSIC",[code])
intrinsic=RTD("tos.rtd",,"INTRINSIC",[code])
probability_itm=RTD("tos.rtd",,"PROB_OF_EXPIRING",[code])
probability_otm=RTD("tos.rtd",,"PROB_OTM",[code])
probability_touch=RTD("tos.rtd",,"PROB_OF_TOUCHING",[code])
covered_return=RTD("tos.rtd",,"COVERED_RETURN",[code])
max_covered_return=RTD("tos.rtd",,"MAX_COVERED_RETURN",[code])
last_update_timestamp

tos_historical_option_data

This table stores daily historical records of option data from thinkorswim desktop.

column_namertd_formulacomment
codePK
date=Date()PK
time=Time()
description=RTD("tos.rtd",,"DESCRIPTION",[code])
last=RTD("tos.rtd",,"LAST",[code])
change=RTD("tos.rtd",,"NET_CHANGE",[code])
percent_change=RTD("tos.rtd",,"PERCENT_CHANGE",[code])
last_size=RTD("tos.rtd",,"LAST_SIZE",[code])
last_x=RTD("tos.rtd",,"LX",[code])
mark=RTD("tos.rtd",,"MARK",[code])
mark_change=RTD("tos.rtd",,"MARK_CHANGE",[code])
mark_percent_change=RTD("tos.rtd",,"MARK_PERCENT_CHANGE",[code])
bid=RTD("tos.rtd",,"BID",[code])
ask=RTD("tos.rtd",,"ASK",[code])
bid_size=RTD("tos.rtd",,"BID_SIZE",[code])
ask_size=RTD("tos.rtd",,"ASK_SIZE",[code])
bid_ask_size=RTD("tos.rtd",,"BA_SIZE",[code])
bid_x=RTD("tos.rtd",,"BX",[code])
ask_x=RTD("tos.rtd",,"AX",[code])
open=RTD("tos.rtd",,"OPEN",[code])
high=RTD("tos.rtd",,"HIGH",[code])
low=RTD("tos.rtd",,"LOW",[code])
close=RTD("tos.rtd",,"CLOSE",[code])
volume=RTD("tos.rtd",,"VOLUME",[code])
open_int=RTD("tos.rtd",,"OPEN_INT",[code])
implied_vol=RTD("tos.rtd",,"IMPL_VOL",[code])
delta=RTD("tos.rtd",,"DELTA",[code])
gamma=RTD("tos.rtd",,"GAMMA",[code])
theta=RTD("tos.rtd",,"THETA",[code])
vega=RTD("tos.rtd",,"VEGA",[code])
rho=RTD("tos.rtd",,"RHO",[code])
extrinsic=RTD("tos.rtd",,"EXTRINSIC",[code])
intrinsic=RTD("tos.rtd",,"INTRINSIC",[code])
probability_itm=RTD("tos.rtd",,"PROB_OF_EXPIRING",[code])
probability_otm=RTD("tos.rtd",,"PROB_OTM",[code])
probability_touch=RTD("tos.rtd",,"PROB_OF_TOUCHING",[code])
covered_return=RTD("tos.rtd",,"COVERED_RETURN",[code])
max_covered_return=RTD("tos.rtd",,"MAX_COVERED_RETURN",[code])
last_update_timestamp

tos_option_data_ticks

This table stores tick-level historical data of option data from thinkorswim desktop.

column_namertd_formulacomment
idPK, IDENTITY
code
datetime=DateTime()
date=Date()
time=Time()
description=RTD("tos.rtd",,"DESCRIPTION",[code])
last=RTD("tos.rtd",,"LAST",[code])
change=RTD("tos.rtd",,"NET_CHANGE",[code])
percent_change=RTD("tos.rtd",,"PERCENT_CHANGE",[code])
last_size=RTD("tos.rtd",,"LAST_SIZE",[code])
last_x=RTD("tos.rtd",,"LX",[code])
mark=RTD("tos.rtd",,"MARK",[code])
mark_change=RTD("tos.rtd",,"MARK_CHANGE",[code])
mark_percent_change=RTD("tos.rtd",,"MARK_PERCENT_CHANGE",[code])
bid=RTD("tos.rtd",,"BID",[code])
ask=RTD("tos.rtd",,"ASK",[code])
bid_size=RTD("tos.rtd",,"BID_SIZE",[code])
ask_size=RTD("tos.rtd",,"ASK_SIZE",[code])
bid_ask_size=RTD("tos.rtd",,"BA_SIZE",[code])
bid_x=RTD("tos.rtd",,"BX",[code])
ask_x=RTD("tos.rtd",,"AX",[code])
open=RTD("tos.rtd",,"OPEN",[code])
high=RTD("tos.rtd",,"HIGH",[code])
low=RTD("tos.rtd",,"LOW",[code])
close=RTD("tos.rtd",,"CLOSE",[code])
volume=RTD("tos.rtd",,"VOLUME",[code])
open_int=RTD("tos.rtd",,"OPEN_INT",[code])
implied_vol=RTD("tos.rtd",,"IMPL_VOL",[code])
delta=RTD("tos.rtd",,"DELTA",[code])
gamma=RTD("tos.rtd",,"GAMMA",[code])
theta=RTD("tos.rtd",,"THETA",[code])
vega=RTD("tos.rtd",,"VEGA",[code])
rho=RTD("tos.rtd",,"RHO",[code])
extrinsic=RTD("tos.rtd",,"EXTRINSIC",[code])
intrinsic=RTD("tos.rtd",,"INTRINSIC",[code])
probability_itm=RTD("tos.rtd",,"PROB_OF_EXPIRING",[code])
probability_otm=RTD("tos.rtd",,"PROB_OTM",[code])
probability_touch=RTD("tos.rtd",,"PROB_OF_TOUCHING",[code])
covered_return=RTD("tos.rtd",,"COVERED_RETURN",[code])
max_covered_return=RTD("tos.rtd",,"MAX_COVERED_RETURN",[code])

This website is using cookies. By continuing to browse, you give us your consent to our use of cookies as explained in our Cookie Policy.