Simian Savants LLC Charting Software LogoSSChart Candlestick Stock Charting Software banner
   IB TWS - Symbol Encoding  TWS as Data Source  
 

Symbol encoding

To get data for futures, options, indices, or stocks on any non-US exchange, you need to use special coding of the symbol name (in a chart or slf file) as follows:

US (SMART routing) Stocks: <symbol>

Other exchange Stocks: <sectype><exchange>_<symbol>
-or-: <sectype>exchange>_<symbol>_<currency>

Indicies: <sectype><exchange>_<symbol>

Futures: <sectype><exchange>_<symbol>_<expiration>

Options: <sectype>_<underlying>_<expiration>_<strike><right>

Cash: <sectype><exchange>_<currency>_<quoted in currency>

Optional prefix of "M~" may be added before any symbol to plot the marketprice which is the average of the current bid and ask or the last trade. This used mainly for FX and Options where the trade volume is too low to get a meaningful graph with trades only.

 <sectype>
 Security type codes:

 C
 Cash (FX)

 F
 Futures

 O
 Options

 I
 Index
   Stock (US SMART routing)

 S
 Stock on specific exchange

 <sectype>  <exchange>  (codes for Cash FX)

 C

 I
 IDEAL

 C

 P
 IDEALPRO

 F

 B
 BELFOX (Belgium)

F
F
 <sectype>  <exchange>  (codes for Futures)

F

 A
 NYBOT (US)

  F

 B
 BELFOX (Belgium)

 F

 C
 CFE (US)

 F

 D
 DTB (Germany)

 F

E
 ECBOT (US)

 F

F
FTA (Netherlands)

 F

G
 GLOBEX (US)

 F

 H
 HKFE (Hong Kong)

 F

 I
SGX (Singapore)

 F

 J
 OSE.JPN (Osaka exchange, Japan)

 F

 K
 CDE (Montreal, Canada)

 F

 L
 LIFFE (UK)

 F

 M
 MEFF (Spain)

 F

 N
 NYMEX (US)

F

 O
 ONE (US One Chicago)

 F

 Q
 NYSELIFFE (US NYSE LIFFE)

 F

 S
 SOFFEX (Switzerland)

 F

 T
 TSE.JPN (Tokyo Japan)

 F

 U
 EUREXUS (US)

 F

 X
 NQLX (US)

 F

 Y
 SNFE (Australia)

 <sectype>  <exchange>  (codes for Indices)

 I

 A
 AMEX (US)

 I

 B
 BELFOX (Belgium)

 I

 C
 CBOE (US)

 I

 D
 DTB (Germany)

 I

 F
 FTA (Netherlands)

 I

 J
 OSE.JPN (Osaka exchange, Japan)

K
CDE (Montreal, Canada)

 I

 L
 LIFFE (UK)

 I

 M
 MEFF (Spain)

 I

 N
 NYSE (US)

 I

 P
 PHLX (US)

 I

 Q
 NASDAQ (US)

 I

 I
 SGX (Singapore)

 I

 S
 SOFFEX (Switzerland)

 I

 T
 TSE.JPN (Tokyo Japan)

 I

 Y
 SNFE (Australia)

 <sectype>

 <exchange>
  (codes for Stocks)

 S

 AMEX (US)

 S

 B
 AEB (Netherlands)

 S

 E
 EBS (Swiss)

 S

 I
 ISLAND (US)

 S

 L
 LSE (UK)

 S

 N
 NYSE (US)

 S

 Q
 NASDAQ (US)

 S

 S
 SWS (Swiss)

 S

 T
 TSE (Canada)

 S

 U
 VENTURE (Canada)

  S

  V
 VIRTX (Swiss)

 S

 W
 WINTERFLOOD (UK)

 S

 X
 IBIS (XETRA Germany)

 S

 Z
 ASX (Australia)
For futures, you must also add the expiration date in the form yyyymm to the symbol.

Examples:

Note _ is the actual underscore character, not a space. Also change the <expiry> dates to something appropriate. Requesting an expired contract will cause TWS to complain (because it is no longer valid).

FG_ES_200506 (S&P 500 E-minis on Globex)
FG_NQ_200506 (Nasdaq 100 futures on Globex)
(If interested in the e-minis check our intraday data download here)
FE_YM_200506 (Dow mini on ECBOT)
FU_TBX_200506 (30 yr treasury bond future on EUEREXUS)
FD_DAX_200506 (DAX index future on DTB)

FH_HSI_200506(Hang Seng Index futures on HKFE)

(Note: you can only get futures data if your TWS account is setup to get it. If you can't get the ticker line in TWS , you won't get it with the router either).

IQ_NDX (nasdaq 100 index)
IP_SOX
(sox index on PHLX)
IC_SPX
(s&p 500 on CBOE)

Tick and Trin symbols:

IN_TICK-NYSE (NYSE tick)
IN_TRIN-NYSE (NYSE Trin, i.e. ARMs index)
IQ_TICK-NASD (NASDAQ tick)
IQ_TRIN-NASD (NASDAQ Trin)
IA_TICK-AMEX (Amex tick)
IA_TRIN-AMEX (Amex trin)

IN_AD-NYSE (NYSE advance-decline line)

INTC (Intel Corporation stock, stocks on US exchanges only require the normal symbol)

O_OEX_200506_550P (OEX Jun05 550 Put option)

M~CP_EUR_USD (CASH FX, EUR quoted in USD, plotted as marketprice rather than trades. On historic backfill, MIDPOINT is requested).

Long form symbol encoding:

For exchanges supported by IB that are not listed in the tables above you can use the long form of <sectype> {STK,FUT,FOP,OPT}, followed by the <exchange> abbreviation {NYSE,GLOBEX, etc.}, for example: FUTGLOBEX_ES_200506, which will return the same data as FG_ES_200506, but the filename used to save the data is the actual symbol you use plus an extension, so use one or the other exclusively for each contract you chart.

To find the correct exchange name, add a ticker line in TWS with the desired contract symbol. RIght click on the ticker (in TWS) select {Contact Info | Description }. The exchange shown there will be the correct <exchange> value to use in SSChart if no abbreviation is shown in the tables above.

For example, for Canadian Government Bond Futures, create ticker line using underlying symbol CGB. Tws show the exchange as: CDE. Working symbol for this contract for SSChart will then be FUTCDE_CGB_200503 for March 2005 future contract.

Single stock futures examples:

FUTNQLX_MSFT_200312 (MSFT future on NQLX)
FUTONE_JPM_200312
(JPM future on OneChicago)

or the prefered abbreviations:

FX_MSFT_200312
FO_JPM_200312

The <symbol> used for the encoding is the underlying symbol used by IB TWS. You can find a complete list of the symbols supported on the IB website under {Trading | Products ....} First find the exchange you are interested then follow the link in the Exchange Details column. The symbols will be listed in the tables under the heading IB Abbreviation.

Stocks on a foreign exchange

In order to get quotes and historical data for stocks traded in other than your base currency, it might be necessary to add the currency to the symbol in the form:<sectype><exchange>_<symbol>_<currency>

For example for a US account to get a canadian stock on the Toronto exchange (TSE) ST_AC_CAD for symbol AC.

Special symbol for your account net liquidating value

Starting with version 2.57 of SSChart (and most recent version of TWS) we automatically save daily and intraday account net liquidating value to a special symbol that can be charted. The symbol will be: A~<account#> so if you account number is U123 the symbol will be A~U123. (This also works for FA client accounts). You should run once for a few minutes then exit and restart SSChart to force the data to be saved to a file before you try to access it. You can put this symbol in a daily chart to keep track of flucuations in your account value.

[Back to Top]

 
Last Revised Monday, 30-Mar-2009 15:36:30 EDT
SSChart is a trademark of Simian Savants LLC
Copyright (c) 1999-2008 Simian Savants LLC. All rights reserved.