Complex Syntax

Complex Syntax provides the most flexibility that it allows users to customize all formula strings individually, where each string only represent one single parameter. There is no rule for the sequence of the appearance of each parameter.

=RTD(**ProgID**, **Server**, **String1**, **String2**, **String3**...)


  • ProgID = "Tws.TwsRtdServerCtrl"
  • Server = "" (empty string)

For example, the formula below will request the Ask Size for IBM@ISLAND:

=RTD("Tws.TwsRtdServerCtrl",,"sym=IBM", "sec=STK", "exch=ISLAND", "qt=AskSize")

The formula below will request the Bid price for IBM:

=RTD("Tws.TwsRtdServerCtrl",,"sym=ES", "sec=FUT", "exch=GLOBEX", "cur=USD", "exp=201712", "qt=Bid")

Complex Syntax Strings

See table below for a full list available Complex Syntax strings:

Name String Syntax Description
Contract ID "conid=" The unique contract ID generated by LYNX. Can be found at TWS Contract Description .
Symbol "sym=" The contract symbol.
SecurityType "sec=" The type of security, e.g. 'STK', 'FUT' and so on.
LastTradeDateOrContractMonth "exp=" Format 'YYYYMMDD' is used for defining the Last Trade Date, while format 'YYYYMM' is used for defining the Contract Month.
Strike "strike=" The strike price for an option contract.
Right "right=" 'C' or 'P' for an option contract.
Multiplier "mult=" The contract multiplier.
Exchange "exch=" The exchange where to get market data from. For equities, 'SMART' means top data from all possible exchanges.
PrimaryExchange "prim=" The primary exchange of the contract. It is mostly specified when an contract ambiguity occurs for equity symbols that are listed on multiple exchanges.

Additional Info

See also: