Excel Rtd Functions Think Or Swim

Overview

Another approach, suitable at least for passive applications, is to monitor real time market data within Excel using the RTD('tos.rtd'.) function. 'tos' is an acronym for Think Or Swim, an option trading subsidiary of TDAmeritrade. The market data, once in Excel, can be accessed from Mathematica using NetLink. TraderXL sounds interesting. Because RTD is a function in Excel, you can take full advantage of the power of Excel with functionality such as cell referencing. To see all of the functions supported in exported data, click on the “Data Export Help” option on the Printer menu.

The RTD database contains preconfigured tables for getting real-time data from Thinkorswim thinkDesktop.

Option tables are designed for getting data for options. Use quote tables for stocks, futures, and currency pairs.

Since RealTimeToDB 2.5, RTD functions are used by default.
To update existing DDE formulas, you can use patches from the database folders.

You can disable unusable columns to reduce the server overhead.

Note that Thinkorswim thinkDesktop can crash if more than 200 000 topics are being requested.

The RTD 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
rtdOptionListTOS
rtdOptionsTOSSELECT Code FROM rtd.OptionListTOS
rtdOptionDayHistoryTOSSELECT Code FROM rtd.OptionListTOS
rtdOptionTickHistoryTOSSELECT Code FROM rtd.OptionListTOS1

MySQL, MariaDB, and PostgreSQL:

TABLE_SCHEMATABLE_NAMELOAD_CODEIS_HISTORY
rtdoption_list_tos
rtdoptions_tosSELECT CODE FROM rtd.option_list_tos
rtdoption_day_history_tosSELECT CODE FROM rtd.option_list_tos
rtdoption_tick_history_tosSELECT CODE FROM rtd.option_list_tos1

Oracle Database, IBM DB2, and NuoDB:

TABLE_SCHEMATABLE_NAMELOAD_CODEIS_HISTORY
RTDOPTION_LIST_TOS
RTDOPTIONS_TOSSELECT CODE FROM RTD.OPTION_LIST_TOS
RTDOPTION_DAY_HISTORY_TOSSELECT CODE FROM RTD.OPTION_LIST_TOS
RTDOPTION_TICK_HISTORY_TOSSELECT CODE FROM RTD.OPTION_LIST_TOS1

* Click on the table name to go to the table description.

Task Table Examples

rtd.OptionListTOS for Microsoft SQL Server and Microsoft SQL Server Compact:

Code
.AAPL150117C500
.AAPL150117C600
.AAPL150117P500
.AAPL150117P600

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

CODE
.AAPL150117C500
.AAPL150117C600
.AAPL150117P500
.AAPL150117P600

Primary Key Columns

Microsoft SQL Server and Microsoft SQL Server Compact:

TABLE_SCHEMATABLE_NAMECOLUMN_NAMERTD_FORMULACOMMENT
rtdOptionsTOSCodePK
rtdOptionDayHistoryTOSCodePK
rtdOptionDayHistoryTOSDate=Date()PK
rtdOptionTickHistoryTOSIDPK, IDENTITY

MySQL, MariaDB, and PostgreSQL:

TABLE_SCHEMATABLE_NAMECOLUMN_NAMERTD_FORMULACOMMENT
rtdoptions_tosCODEPK
rtdoption_day_history_tosCODEPK
rtdoption_day_history_tosDATE=Date()PK
rtdoption_tick_history_tosIDPK, IDENTITY

Oracle Database, IBM DB2, and NuoDB:

TABLE_SCHEMATABLE_NAMECOLUMN_NAMERTD_FORMULACOMMENT
RTDOPTIONS_TOSCODEPK
RTDOPTION_DAY_HISTORY_TOSCODEPK
RTDOPTION_DAY_HISTORY_TOSDATE=Date()PK
RTDOPTION_TICK_HISTORY_TOSIDPK, IDENTITY

Real-Time Formulas for Microsoft SQL Server and Microsoft SQL Server Compact

rtd.OptionsTOS

The table contains the last values of option data from Thinkorswim thinkDesktop.

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])
PercentChange=RTD('tos.rtd','PERCENT_CHANGE',[Code])
LastSize=RTD('tos.rtd','LAST_SIZE',[Code])
LastX=RTD('tos.rtd','LX',[Code])
Mark=RTD('tos.rtd','MARK',[Code])
MarkChange=RTD('tos.rtd','MARK_CHANGE',[Code])
MarkPercentChange=RTD('tos.rtd','MARK_PERCENT_CHANGE',[Code])
Bid=RTD('tos.rtd','BID',[Code])
Ask=RTD('tos.rtd','ASK',[Code])
BidSize=RTD('tos.rtd','BID_SIZE',[Code])
AskSize=RTD('tos.rtd','ASK_SIZE',[Code])
BidAskSize=RTD('tos.rtd','BA_SIZE',[Code])
BidX=RTD('tos.rtd','BX',[Code])
AskX=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])
OpenInt=RTD('tos.rtd','OPEN_INT',[Code])
ImpliedVol=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])
ProbabilityITM=RTD('tos.rtd','PROB_OF_EXPIRING',[Code])
ProbabilityOTM=RTD('tos.rtd','PROB_OTM',[Code])
ProbabilityTouch=RTD('tos.rtd','PROB_OF_TOUCHING',[Code])
CoveredReturn=RTD('tos.rtd','COVERED_RETURN',[Code])
MaxCoveredReturn=RTD('tos.rtd','MAX_COVERED_RETURN',[Code])
LastUpdateTimeStamp

rtd.OptionDayHistoryTOS

The table contains day history of option data from Thinkorswim thinkDesktop.

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])
PercentChange=RTD('tos.rtd','PERCENT_CHANGE',[Code])
LastSize=RTD('tos.rtd','LAST_SIZE',[Code])
LastX=RTD('tos.rtd','LX',[Code])
Mark=RTD('tos.rtd','MARK',[Code])
MarkChange=RTD('tos.rtd','MARK_CHANGE',[Code])
MarkPercentChange=RTD('tos.rtd','MARK_PERCENT_CHANGE',[Code])
Bid=RTD('tos.rtd','BID',[Code])
Ask=RTD('tos.rtd','ASK',[Code])
BidSize=RTD('tos.rtd','BID_SIZE',[Code])
AskSize=RTD('tos.rtd','ASK_SIZE',[Code])
BidAskSize=RTD('tos.rtd','BA_SIZE',[Code])
BidX=RTD('tos.rtd','BX',[Code])
AskX=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])
OpenInt=RTD('tos.rtd','OPEN_INT',[Code])
ImpliedVol=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])
ProbabilityITM=RTD('tos.rtd','PROB_OF_EXPIRING',[Code])
ProbabilityOTM=RTD('tos.rtd','PROB_OTM',[Code])
ProbabilityTouch=RTD('tos.rtd','PROB_OF_TOUCHING',[Code])
CoveredReturn=RTD('tos.rtd','COVERED_RETURN',[Code])
MaxCoveredReturn=RTD('tos.rtd','MAX_COVERED_RETURN',[Code])
LastUpdateTimeStamp

rtd.OptionTickHistoryTOS

The table contains tick history of option data from Thinkorswim thinkDesktop.

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])
PercentChange=RTD('tos.rtd','PERCENT_CHANGE',[Code])
LastSize=RTD('tos.rtd','LAST_SIZE',[Code])
LastX=RTD('tos.rtd','LX',[Code])
Mark=RTD('tos.rtd','MARK',[Code])
MarkChange=RTD('tos.rtd','MARK_CHANGE',[Code])
MarkPercentChange=RTD('tos.rtd','MARK_PERCENT_CHANGE',[Code])
Bid=RTD('tos.rtd','BID',[Code])
Ask=RTD('tos.rtd','ASK',[Code])
BidSize=RTD('tos.rtd','BID_SIZE',[Code])
AskSize=RTD('tos.rtd','ASK_SIZE',[Code])
BidAskSize=RTD('tos.rtd','BA_SIZE',[Code])
BidX=RTD('tos.rtd','BX',[Code])
AskX=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])
OpenInt=RTD('tos.rtd','OPEN_INT',[Code])
ImpliedVol=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])
ProbabilityITM=RTD('tos.rtd','PROB_OF_EXPIRING',[Code])
ProbabilityOTM=RTD('tos.rtd','PROB_OTM',[Code])
ProbabilityTouch=RTD('tos.rtd','PROB_OF_TOUCHING',[Code])
CoveredReturn=RTD('tos.rtd','COVERED_RETURN',[Code])
MaxCoveredReturn=RTD('tos.rtd','MAX_COVERED_RETURN',[Code])

Real-Time Formulas for MySQL, MariaDB, Oracle Database, IBM DB2, NuoDB, and PostgreSQL

rtd.options_tos

The table contains the last values of option data from Thinkorswim thinkDesktop.

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

rtd.option_day_history_tos

The table contains day history of option data from Thinkorswim thinkDesktop.

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

rtd.option_tick_history_tos

The table contains tick history of option data from Thinkorswim thinkDesktop.

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])

Seeking a creation of an Excel RTD using MT5 as the source platform.

The RTD is to source data from the MT5 platform, it will be able to be source data from Mt5 and display this within Excel.It will be able to open and close trades in real-time and include account, symbol, indicator, ticket, and price data.

This RTD will have similar functionality as the following

FX Blue Labs || Apps || Excel RTD

High Level functions required

  1. the app will be able to report on all available symbols in the platform (i.e. available from the market watch window within MT5)

2. The app will be able to report account data properties

3. The app will be able to show all price and symbol data properties

4. The app will be able to report all open ticket data properties

5. The app will be able to report all closed ticket data properties

6. The app will be able to display indicators value included within the standard MT5 platform.Custom indicators are not required.

7. The app will be able to open and close trades from commands within Excel via a RTD string.

8. The app will be able to display open and closed trades.

9. The app will be able to execute, buy, sell, buy limit order, sell limit order fill or kill order and modify an order.

10. The app will be able to specify the lot size for an order.This will be sourced from Excel.

Functions

A. Symbols

All symbols are to be displayed from the market watch window.

B. Price and symbol data properties

1. Bid

2. Ask

3. High

4. Low

5. Open

6. Close

7. Time

8. Range

C. Time periods

The app will supply the following information about each 'ticket”

The app will be able to choose a time.Ie M1, M5, M10 etc

D. Bar history

Excel RTD app to request recent price history from the platform

E. Timeframe value

Excel Rtd Functions Think Or Swim Free

The bar timeframe can either be specified as a number of minutes

F. Bar shift

Bars are numbered with the newest at zero, and increasing in order of age. In other words, bar 0 is the current in-progress bar; bar 1 is the last complete bar

  1. Technical indicators

The Excel RTD app will include indicator calculations that are standard to the MT5 platform.

Excel rtd functions think or swim tutorial

The formula to display an indicator will include the symbol, timeframe, data (e.g. close, high, low), period, shift and additional parameters depending on indicator.

H. Ticket volumes

The app reports the volumes on tickets as the nominal volume

I. Active tickets to display

- S/L

- T/P

- Price

- Swap

Excel Rtd Example

- Profit

- Balance

- Equity

- Margin

- Free margin

J. History

- Time

- Deal

- Order

- Symbol

- Type

- Direction

- Volume

- Price

- S/L

- T/P

- Profit

1.Sending and managing realtime orders from Excel to Meta The app will be able to report all open ticket data properties

J.trader 5

Excel Rtd Functions Think Or Swim Tutorial

(This can be done via a VBA macro within excel to MT5)

Think Or Swim App Download

- Buy

- Sell

- Buy limit order

- Sell limit order

- Buy stop order

- Sell stop order

- Fill or kill order

Td Ameritrade

- Modify order

- Cancel order

12. Excel formula syntax

=RTD('prog id', , 'account ', 'properties, 1, 2, 3 etc')


Thinkorswim Download