8 Lookup of symbols and codes

A list of symbols and lookup codes that match a specified set of criteria can be retrieved using the 'lookup' and 'chain' actions. Various different lookups can be requested, which differ by the DataType parameter.

8.1 Symbols lookup

To retrieve a list of symbols that match certain criteria, set the action to 'lookup', DataType to 'symbols' and add one or more filtering criteria: Name, Description, Market, SecType, SIC, and/or NAICS:

>> data = IQML('lookup', 'DataType','symbols', 'Name','IBM')
data =
1086×1 struct array with fields:
Symbol
Description
Market_ID
Market_Name
Sec_Type_ID
Sec_Type

>> data(1)
ans =
Symbol: 'IBM'
Description: 'INTERNATIONAL BUSINESS MACHINE'
Market_ID: 7
Market_Name: 'New York Stock Exchange (NYSE)'
Sec_Type_ID: 1
Sec_Type: 'Equity'

>> data(2)
ans =
Symbol: 'IBMG'
Description: 'ISHARES IBONDS SEP 2018 MUNI BOND'
Market_ID: 11
Market_Name: 'NYSE Archipelago (NYSE_ARCA)'
Sec_Type_ID: 1
Sec_Type: 'Equity'

>> data(9)
ans =
Symbol: 'IBM1804E120'
Description: 'IBM MAY 2018 C 120.00'
Market_ID: 14
Market_Name: 'OPRA System'
Sec_Type_ID: 2
Sec_Type: 'Index/Equity Option'

>> data(end)
ans =
Symbol: 'IBZ18-IBM19'
Description: '30 DAY INTERBANK CASH RATE DEC 18/JUN 19'
Market_ID: 64
Market_Name: 'ASX24 Commodities Exchange (ASXCM)'
Sec_Type_ID: 10
Sec_Type: 'Future Spread'

IQFeed returns a list of symbols whose symbol name contains (not necessarily begins with) the term 'IBM', from different markets (exchanges) and different security types.

Note that the Name and Description filtering criteria are case-insensitive (so 'IBM', 'Ibm' and 'ibm' would all result in the same list of symbols), and also that they match their string value anywhere within the corresponding asset field.

You can narrow-down the results by entering more-specific parameter values (e.g. 'IBM180' rather than 'IBM'), or by specifying additional filtering parameters. For example, to filter the IBM list just to assets that include ‘business’ in their Description:

>> data = IQML('lookup', 'DataType','symbols', 'name','ibm', ...
'Description','business')
data =
8×1 struct array with fields:
Symbol
Description
Market_ID
Market_Name
Sec_Type_ID
Sec_Type

>> data = struct2table(data)
data =
8×6 table

???

Unlike the Name and Description (which match strings), the SIC and NAICS parameters are numeric and match the beginning of the corresponding SIC/NAICS sector/industry code. For example, the following query returns all assets that have 'inc' in their Description and belong to any sector whose SIC code begins with 83:118

>> data = IQML('lookup', 'DataType','symbols', 'Description','inc', 'SIC',83)
data =
6×1 struct array with fields:
Symbol
Description
Market_ID
Market_Name
Sec_Type_ID
Sec_Type
SIC_ID
SIC_Desc

>> data(1)
ans =
Symbol: 'HQGE'
Description: 'HQ GLOBAL ED INC'
Market_ID: 3
Market_Name: 'Nasdaq other OTC'
Sec_Type_ID: 1
Sec_Type: 'Equity'
SIC_ID: 8331
SIC_Desc: 'JOB TRAINING AND VOCATIONAL REHABILITATION SERVICES'

>> disp({data.Symbol; data.Description; data.SIC_ID; data.SIC_Desc}')
'HQGE' 'HQ GLOBAL ED INC' [8331] 'JOB TRAINING AND ...'
'KVIL' 'KIDVILLE INC' [8351] 'CHILD DAY CARE SERVICES'
'DRWN' 'A CLEAN SLATE INC.' [8361] 'RESIDENTIAL CARE'
'NVOS' 'NOVO INTEGRATED SCIENCES INC...' [8361] 'RESIDENTIAL CARE'
'SPRV' 'SUPURVA HEALTHCARE GROUP INC...' [8361] 'RESIDENTIAL CARE'

When you specify a SIC or NAICS filtering criteria, the result contains two additional fields (either SIC_ID and SIC_Desc, or NAICS_ID and NAICS_Desc, respectively), in addition to the standard fields (Symbol, Description, Market_ID, Market_Name, Sec_Type_ID and Sec_Type).119

Note that it is possible that not all the requested symbols will be received before IQML’s timeout (default value: 5 secs) returns the results:120

>> data = IQML('lookup', 'DataType','symbols', 'Name','GOOG')

Warning: IQML timeout: only partial data is returned. Perhaps the Timeout parameter should be set to a value larger than 5

data =
3848×1 struct array with fields:
Symbol
Description
Market_ID
Market_Name
Sec_Type_ID
Sec_Type

To control the maximal duration that IQML will wait for the data, set the Timeout parameter. For example, to wait up to 30 secs to collect the complete list of symbols:

>> data = IQML('lookup', 'DataType','symbols', 'Name','GOOG', 'timeout',30)

data =
6812×1 struct array with fields:
...

Naturally, it is quite possible that no symbol is found that matches the requested criteria. In such a case, the result will be empty (and cannot be displayed using Matlab’s struct2table() or struct2cell() functions):

>> data = IQML('lookup', 'DataType','symbols', 'Description','inc', 'NAICS',83)
data =
[]

>> struct2cell(data)

Undefined function 'struct2cell' for input arguments of type 'double'.

An error message will result if you try to specify both SIC and NAICS filtering criteria – only one (or none) of them is permitted in a lookup query:

>> data = IQML('lookup', 'DataType','symbols', 'NAICS',1234, 'SIC',83)

You can specify either SIC or NAICS parameter, but not both of them, in a symbol lookup query

An error message will also result if you do not specify at least one of the filtering criteria Name, Description, SIC, NAICS:

>> data = IQML('lookup', 'DataType','symbols')

Either Name, Description, SIC or NAICS parameters must be specified in a symbol lookup query

You can filter the results based on one or more markets, and/or security types, using the Market and SecType parameters (see §8.3, §8.4 for valid values). For example:

>> struct2table(IQML('lookup', 'datatype','symbols', 'name','GOOG', 'SecType','Equity'))
ans =
2×6 table
Symbol Description Market_ID Market_Name Sec_Type_ID Sec_Type
_______ ______________________ _________ ________________ ___________ ________
'GOOG' 'ALPHABET INC CLASS C' 21 'Nasdaq Global Select Market (NGSM)' 1 'Equity'
'GOOGL' 'ALPHABET INC CLASS A' 21 'Nasdaq Global Select Market (NGSM)' 1 'Equity'

>> data = IQML('lookup', 'datatype','symbols', 'name','GOOG', 'Market','NGSM');

Multiple Markets and/or SecTypes121 can be specified using a cell array. For example, to get the list of all active (non-expired) GOOG equities and options:122

>> data = IQML('lookup', 'datatype','symbols', 'name','GOOG', ...
'SecTypes',{'Equity','IEOption'}, 'Timeout',20)
data =
8056×1 struct array with fields:
Symbol
Description
Market_ID
Market_Name
Sec_Type_ID
Sec_Type

You can specify both Market(s) and SecType(s) to get an even more granular filtering. For example, to lookup only future options traded on CBOT:

>> data = IQML('lookup', 'datatype','symbols', 'name',symbol, ...
'SecTypes','FOption', ‘Markets','CBOT');

Similarly, to lookup VIX (volatility) futures and future-spreads (but not combined future volume OI symbols such as @VX1.OI.Z) on the CBOE Futures Exchange (CFE):

>> data = IQML('lookup', 'datatype','symbols', 'name','vx', ...
'SecTypes',{'Future','Spread'}, 'Markets','CFE');

If you specify one or more invalid Market(s) or SecType(s), you will get an error. For example, a typical error is to specify a SecType of 'Option' instead of 'IEOption':

>> d = IQML('lookup','datatype','symbols','name','GOOG','SecTypes',{'Equity','Option'})

Invalid SecType(s) "OPTION". Allowed values: ARGUS, ARGUSFC, BONDS, CALC,
COMBINED_FOPTION, COMBINED_FUTURE, COMM3, EQUITY, FAST_RACKS, FOPTION, FOPTION_IV, FOREX, FORWARD, FUTURE, ICSPREAD, IEOPTION, INDEX, ISO, JACOBSEN, MKTRPT, MKTSTATS, MONEY, MUTUAL, NP_CAPACITY, NP_FLOW, NP_POWER, PETROCHEMWIRE, PRECMTL, RACKS, RFSPOT, SNL_ELEC, SNL_NG, SPOT, SPREAD, STRATSPREAD, STRIP, SWAPS, TREASURIES

Instead of Market name(s) or SecType name(s), you can specify their corresponding numeric codes,123 as a scalar integer value or as a numeric array of integers:

>> data = IQML('lookup','datatype','symbols','name','GOOG','SecTypes',1);

>> data = IQML('lookup','datatype','symbols','name','GOOG','SecTypes',[1,2]);

>> data = IQML('lookup','datatype','symbols','name','GOOG','Markets',21);

>> data = IQML('lookup','datatype','symbols','name','GOOG',’Markets',[21,14]);

Here is a summary of the IQML parameters that affect symbols lookup:

Parameter

Data type

Default

Description

Name

string

''
(empty string)

Limits the query to assets that contain the specified string in their symbol name (case insensitive, anywhere within the symbol name)

Description

string

''
(empty string)

Limits the query to assets that contain the specified string in their description (case insensitive, anywhere within the description)

Market or Markets 124

integer, numeric array, string, or cell-array of strings

[] (empty)

Limits the query to assets that belong to the specified market code(s) (scalar integer or numeric array), or market name(s) (case-insensitive string or cell-array of strings).

See §8.3 for details on valid values.

SecType or SecTypes 125

integer, numeric array, string, or cell-array of strings

[] (empty)

Limits the query to assets that have the specified security type code(s) (scalar integer or numeric array), or security type name(s) (case-insensitive string or cell-array of strings).

See §8.4 for details on valid values.

SIC

integer

[] (empty)

Limits the query to assets that belong to the specified SIC sector/industry
(matches the beginning of the SIC number)

See §8.5 for details on valid values.

NAICS

integer

[] (empty)

Limits the query to assets that belong to the specified NAICS sector/industry
(matches the beginning of the NAICS number)

See §8.6 for details on valid values.

Timeout

number

5.0

Max # of seconds to wait for incoming data
(0-9000, where 0 means infinite)

8.2 Options/futures chain

To retrieve a list of symbols that belong to a certain options/futures chain and match certain criteria, set the action to 'chain'; DataType to one of 'options' (default), 'futures', 'foptions' (future options), or 'spreads'; Symbol to the underlying contract’s symbol; and then add optional filtering criteria. For example:126

>> symbols = IQML('chain', 'Symbol','GOOG')' % options chain for GOOG
symbols =
1×1454 cell array
Columns 1 through 4
'GOOG1803H1000' 'GOOG1803H1010' 'GOOG1803H1020' 'GOOG1803H1030'
Columns 5 through 8
'GOOG1803H1040' 'GOOG1803H1050' 'GOOG1803H1055' 'GOOG1803H1060'
Columns 9 through 12
'GOOG1803H1065' 'GOOG1803H1070' 'GOOG1803H1075' 'GOOG1803H1077.5'
...

Depending on DataType, several filtering parameters can be specified: All chain queries support the Symbol, Months, and NearMonths parameters. Options-related queries (DataType='options' or 'foptions') also support a Side parameter. Index/equity options query (DataType='options') also supports IncludeBinary, MinStrike, MaxStrike, NumInMoney, NumOutOfMoney parameters. All chain queries except 'options' also support the Years parameter. Here’s an example filtered chain query:

% Report GOOG options having strike price between $1000-$1010 in next 4 months
>> symbols = IQML(
'chain', 'symbol','GOOG', 'NearMonths',4, ...
'MinStrike',1000, 'MaxStrike',1010)'
symbols =
1×58 cell array
Columns 1 through 4
'GOOG1803H1000' 'GOOG1803H1010' 'GOOG1810H1000' 'GOOG1810H1005'
Columns 5 through 8
'GOOG1810H1010' 'GOOG1813G1000' 'GOOG1813G1002.5' 'GOOG1813G1005'
Columns 9 through 12
'GOOG1813G1007.5' 'GOOG1813G1010' 'GOOG1817H1000' 'GOOG1817H1005'
...

The following table lists the valid combinations of filtering parameters per DataType:

↓parameter \ DataType:

options

future

spread

foption

Symbol

ok

ok

ok

ok

Side

ok

N/A

N/A

ok

Months

ok

ok

ok

ok

NearMonths

ok

ok

ok

ok

Years

N/A

ok

ok

ok

IncludeBinary

ok

N/A

N/A

N/A

MinStrike

ok

N/A

N/A

N/A

MaxStrike

ok

N/A

N/A

N/A

NumInMoney

ok

N/A

N/A

N/A

NumOutOfMoney

ok

N/A

N/A

N/A

Note that if you filter by MinStrike and/or MaxStrike, you cannot also filter by NumInMoney/ NumOutOfMoney (and vice versa):

>> IQML('chain', 'symbol','FB','NumInMoney',2,'NumOutOfMoney',2,'MinStrike',90)

You cannot specify both a strike range and number of contracts in/out of money in 'chain' query - choose only one set

Similarly, you can only specify one of the Months, NearMonths parameters, not both:

>> IQML('chain', 'symbol','FB', 'Months',2:6, 'NearMonths',3)

Either the Months or the NearMonths parameter can be specified, but not both, in a 'chain' query

If no symbols match the specified criteria, or if you do not have the necessary market permissions (subscription), then the IQML query will return an empty cell array:

>> symbols = IQML('chain', 'datatype','spreads','symbol','C','years',2010:2019)
symbols =
0×0 empty cell array

warningNote: IQFeed only returns active (non-expired) contracts. A [huge] static text file containing a [very long] list of expired symbols is available for download,127 and starting with IQFeed client 6.1 you can also fetch this data using IQML (see §5.6).

If you set WhatToShow to 'quotes', you’ll receive an array of structs that contain the corresponding latest (top-of-market) quotes data for the corresponding symbols:

>> data = IQML('chain', 'symbol','GOOG', 'NearMonths',4, ...
'MinStrike',1000, 'MaxStrike',1010, ...
'WhatToShow','quotes')
data =
58×1 struct array with fields:
Symbol
...

>> data(1)
ans =
struct with fields:
Symbol: 'GOOG1803H1000'
Most_Recent_Trade: 120
Most_Recent_Trade_Size: 1
Most_Recent_Trade_Time: '15:57:12.930497'
Total_Volume: 0
Bid: 140.5
Bid_Size: 3
Ask: 150.1
Ask_Size: 1
...
Close: 120
Message_Contents: 'Cbacv'
Message_Description: ...
Most_Recent_Trade_Conditions: 1
Trade_Conditions_Description: 'Normal Trade'
Most_Recent_Market_Name: 'MIAX PEARL Options exchange'

>> symbols = {data.Symbol}
symbols =
1×58 cell array
Columns 1 through 4
'GOOG1803H1000' 'GOOG1803H1010' 'GOOG1810H1000' 'GOOG1810H1005'
Columns 5 through 8
'GOOG1810H1010' 'GOOG1813G1000' 'GOOG1813G1002.5' 'GOOG1813G1005'
...

Note: if you request quotes for multiple chain symbols, especially if you set UseParallel to true, you might reach your IQFeed account’s symbols-limit (MaxSymbols; see §9.3). In such cases, IQFeed-generated error messages will be displayed on the Matlab console:

Level1 symbol limit reached - symbol 'GOOG2019R600' not serviced!

Also note that some of these structs (especially for out-of-money contracts) may contain empty/invalid data, since their corresponding contract was never traded. For example:

>> data(7)
ans =
struct with fields:
Symbol: 'GOOG1813G1002.5'
Most_Recent_Trade: []
Most_Recent_Trade_Size: []
Most_Recent_Trade_Time: []
Most_Recent_Trade_Market_Center: []
Total_Volume: 0
Bid: 133.4
Bid_Size: 2
Ask: 140.2
Ask_Size: 1
Open: []
High: []
Low: []
Close: []
Message_Contents: 'bav'
Message_Description: 'A bid update occurred; An ask update occurred; A volume update occurred'
Most_Recent_Trade_Conditions: 1
Trade_Conditions_Description: 'Normal Trade'
Most_Recent_Market_Name: ''

For this reason, you should be careful when concatenating the struct array’s data into numeric arrays. In this example, only 40 of the 58 contracts had a Close price, so concatenating into a numeric array results in an array that only has 40 data items:

>> [data.Close]
ans =
Columns 1 through 8
120 130.7 140.67 131.99 150.1 138.8 139.5 99.47
Columns 9 through 16
103.28 130.9 179.5 137.5 190.17 89.3 145 3.84
Columns 17 through 24
6 7.5 5.3 7.14 0.3 0.3 1.1 1.32
Columns 25 through 32
1.05 5.56 9.9 6.35 0.67 0.75 1.23 10
Columns 33 through 40
15.43 16.33 27.21 32.3 33.4 6.49 2.5 3.37

…instead, it is better in most cases to use cell arrays, where we can see empty cells:

>> {data.Close}
ans =
1×58 cell array
Columns 1 through 8
[120] [] [130.7] [] [] [140.67] [] []
Columns 9 through 16
[] [] [131.99] [150.1] [138.8] [139.5] [] [99.47]
Columns 17 through 24
[] [103.28] [130.9] [179.5] [137.5] [190.17] [] [89.3]
Columns 25 through 33
...

Similarly, set WhatToShow='fundamental' to get the fundamental data for all symbols in the requested chain. For example:

>> data = IQML('chain', 'symbol','GOOG', 'NearMonths',4, ...
'MinStrike',1000, 'MaxStrike',1010, ...
'WhatToShow','fundamental')
data =
58×1 struct array with fields:
Symbol
Exchange_ID
PE
Average_Volume
x52_Week_High
x52_Week_Low
Calendar_Year_High
Calendar_Year_Low
...

>> data(1)
ans =
struct with fields:
Symbol: 'GOOG1803H1000'
Exchange_ID: 'E'
PE: []
Average_Volume: []
x52_Week_High: 120
x52_Week_Low: 120
Calendar_Year_High: []
Calendar_Year_Low: []
...
Fiscal_Year_End: []
Company_Name: 'GOOG AUG 2018 C 1000.00'
...
Expiration_Date: '08/03/2018'
Strike_Price: 1000
NAICS: []
Exchange_Root: []
Option_Premium_Multiplier: 100
Option_Multiple_Deliverable: 0
Price_Format_Description: 'Two decimal places'
Exchange_Description: 'Euronext Index Derivatives (ENID)'
Listed_Market_Description: 'OPRA System'
Security_Type_Description: 'Index/Equity Option'
SIC_Description: ''
NAICS_Description: ''

>> [data.Strike_Price]
ans =
Columns 1 through 8
1000 1010 1000 1005 1010 1000 1002.5 1005
Columns 9 through 16
1007.5 1010 1000 1005 1010 1000 1002.5 1005
Columns 17 through 24
1007.5 1010 1000 1005 1010 1000 1005 1010
Columns 25 through 32
1000 1005 1010 1000 1010 1000 1010 1000
Columns 33 through 40
1005 1010 1000 1002.5 1005 1007.5 1010 1000
Columns 41 through 48
1005 1010 1000 1002.5 1005 1007.5 1010 1000
Columns 49 through 56
1005 1010 1000 1005 1010 1000 1005 1010
Columns 57 through 58
1000 1010

Here is a summary of the IQML parameters that affect chain symbols lookup:

Parameter

Data type

Default

Description

Symbol

string

''

must be set!

Symbol name of the underlying contract. This is a mandatory parameter it must be set.
Note: Multiple symbols are NOT supported.

DataType

string

'options'

One of:

'options' (default) – on index/equity

'future'

'spread' – future calendar spreads

'foptions' – options on future

Side

string

'cp'

(meaning both calls and puts)

One of:

'cp' (default) – both calls and puts

'c' – calls only

'p' – puts only

Only relevant if DataType='options'/'foptions'

WhatToShow

string

'symbols'

One of:

'symbols' (default) list of symbols in chain

'quotes' – return the latest quotes data

'fundamental' – return fundamental data

Months

various

[] meaning all

One of:

Numeric month value(s) between 1-12 (e.g.: 4, 2:5, [1,4,7])

English month name (e.g. 'August', 'Apr')

English month names in cell array (e.g. {'Apr', 'July', 'September', 'Dec'})

Financial month codes from the list FGHJKMNQUVXZ (e.g. 'JKMN')

Cannot be specified together with NearMonths

NearMonths

integer (0-99)

[]

Number of nearby contract months to report.128 Cannot be specified together with Months.

Years

integer scalar/array

[] meaning current year

1+ years e.g. 2013:2019, default: current year. Only relevant when DataType ≠ 'options'.

IncludeBinary

logical

false or 0

If true, binary/weekly options129 are reported, otherwise (default) they are not. This parameter is only relevant when DataType='options'.

MinStrike

number

[]

Only report options having a higher strike price; only relevant when DataType='options'.

MaxStrike

number

[]

Only report options having a lower strike price; only relevant when DataType='options'.

NumInMoney

integer

[]

Only report this number of options in the money; only relevant if DataType='options'.

NumOutOf
Money

integer

[]

Only report this number of options out of money; only relevant if DataType='options'.

UseParallel

logical (true/false)

false

If set to true or 1, then querying chain quotes will be done in parallel if possible (see §3.6).

warningNote: Options/futures chain lookup is only available in the Professional IQML license.

8.3 Markets lookup

To retrieve a list of markets (exchanges), set the action to 'lookup' and DataType to 'markets':

>> data = IQML('lookup', 'DataType','markets')
data =
474×1 struct array with fields:
id
name
description
groupId
groupName

>> data(1)
ans =
id: 1
name: 'NGM'
description: 'Nasdaq Global Market'
groupId: 5
groupName: 'NASDAQ'

>> data(2)
ans =
id: 2
name: 'NCM'
description: 'National Capital Market'
groupId: 5
groupName: 'NASDAQ'

You can convert the data into a [perhaps] more readable form using Matlab’s builtin struct2cell() and struct2table() functions:

>> struct2cell(data)'
ans =
9×5 cell array
[1] 'NGM' 'Nasdaq Global Market' [5] 'NASDAQ'
[2] 'NCM' 'National Capital Market' [5] 'NASDAQ'
[3] 'OTC' 'Nasdaq other OTC' [5] 'NASDAQ'
[4] 'OTCBB' 'Nasdaq OTC Bulletin Board' [5] 'NASDAQ'
[5] 'NASDAQ' 'Nasdaq' [5] 'NASDAQ'
[6] 'NYSE_AMERICAN' 'NYSE American (Equities and Bonds)' [6] 'NYSE_AMERICAN'
[7] 'NYSE' 'New York Stock Exchange' [7] 'NYSE'
[8] 'CHX' 'Chicago Stock Exchange' [0] 'NONE'
[9] 'PHLX' 'Philadelphia Stock Exchange' [0] 'NONE'
...

>> struct2table(data)
ans =
9×5 table
id name description groupId groupName
__ _______________ ____________________________________ _______ _____________
1 'NGM' 'Nasdaq Global Market' 5 'NASDAQ'
2 'NCM' 'National Capital Market' 5 'NASDAQ'
3 'OTC' 'Nasdaq other OTC' 5 'NASDAQ'
4 'OTCBB' 'Nasdaq OTC Bulletin Board' 5 'NASDAQ'
5 'NASDAQ' 'Nasdaq' 5 'NASDAQ'
6 'NYSE_AMERICAN' 'NYSE American (Equities and Bonds)' 6 'NYSE_AMERICAN'
7 'NYSE' 'New York Stock Exchange' 7 'NYSE'
8 'CHX' 'Chicago Stock Exchange' 0 'NONE'
9 'PHLX' 'Philadelphia Stock Exchange' 0 'NONE'

You can narrow-down the results by specifying the Name and/or the Description filtering parameters. For example, let’s display only the markets that contain ‘Nasdaq’ in their Description:

>> data = IQML('lookup', 'DataType','markets', 'Description','Nasdaq')
data =
10×1 struct array with fields:
id
name
description
groupId
groupName

>> disp(struct2cell(data)')
[ 1] 'NGM' 'Nasdaq Global Market' [ 5] 'NASDAQ'
[ 3] 'OTC' 'Nasdaq other OTC' [ 5] 'NASDAQ'
[ 4] 'OTCBB' 'Nasdaq OTC Bulletin Board' [ 5] 'NASDAQ'
[ 5] 'NASDAQ' 'Nasdaq' [ 5] 'NASDAQ'
[ 15] 'NASD_ADF' 'Nasdaq Alternate Display facility' [ 5] 'NASDAQ'
[ 19] 'NTRF' 'Nasdaq Trade Reporting Facility' [ 5] 'NASDAQ'
[ 21] 'NGSM' 'Nasdaq Global Select Market' [ 5] 'NASDAQ'
[105] 'PK_NASDAQ' 'Pink Sheets - NASDAQ Listed' [ 90] 'PK_SHEETS'
[134] 'N2EX' 'NASDAQ OMX-Nord Pool' [134] 'N2EX'
[139] 'NFX' 'NASDAQ OMX Futures' [139] 'NFX'

Naturally, it is quite possible that no markets exist that match the requested criteria. In such a case, the result will be empty (and cannot be displayed using Matlab’s struct2table() or struct2cell() functions):

>> data = IQML('lookup', 'DataType','markets', 'Name','xyz')
data =
[]

>> struct2cell(data)

Undefined function 'struct2cell' for input arguments of type 'double'.

Here is a summary of the IQML parameters that affect markets lookup:

Parameter

Data type

Default

Description

Name

string

''
(empty string)

Limits the query to markets that contain the specified string in their name or groupName (case insensitive, anywhere within the name)

Description

string

''
(empty string)

Limits the query to markets that contain the specified string in their description (case insensitive, anywhere within the description)

8.4 Security types lookup

To retrieve a list of security types, set action to 'lookup' and DataType to 'sectypes':

>> data = IQML('lookup', 'DataType','sectypes')
data =
38×1 struct array with fields:
id
name

>> data(1)
ans =
id: 1
name: 'EQUITY'
description: 'Equity'

>> data(2)
ans =
id: 2
name: 'IEOPTION'
description: 'Index/Equity Option'

You can convert the data into a [perhaps] more readable form using Matlab’s builtin struct2cell() and struct2table() functions:

>> disp(struct2cell(data)')

[ 1] 'EQUITY' 'Equity'
[ 2] 'IEOPTION' 'Index/Equity Option'
[ 3] 'MUTUAL' 'Mutual Fund'
[ 4] 'MONEY' 'Money Market Fund'
[ 5] 'BONDS' 'Bond'
[ 6] 'INDEX' 'Index'
[ 7] 'MKTSTATS' 'Market Statistic'
[ 8] 'FUTURE' 'Future'
[ 9] 'FOPTION' 'Future Option'
[10] 'SPREAD' 'Future Spread'
[11] 'SPOT' 'Spot'
[12] 'FORWARD' 'Forward'
[13] 'CALC' 'DTN Calculated Statistic'
[14] 'STRIP' 'Calculated Future Strip'
[16] 'FOREX' 'Foreign Monetary Exchange'
[17] 'ARGUS' 'Argus Energy'
[18] 'PRECMTL' 'Precious Metals'
[19] 'RACKS' 'Racks Energy'
[20] 'RFSPOT' 'Refined Fuel Spot'
[21] 'ICSPREAD' 'Inter-Commodity Future Spread'
[22] 'STRATSPREAD' 'Strategy Spread'
[23] 'TREASURIES' 'Treasuries'
[24] 'SWAPS' 'Interest Rate Swap'
[25] 'MKTRPT' 'Market Reports'
[26] 'SNL_NG' 'SNL Natural Gas'
[27] 'SNL_ELEC' 'SNL Electricity'
[28] 'NP_CAPACITY' 'Nord Pool-N2EX Capacity'
[29] 'NP_FLOW' 'Nord Pool-N2EX Flow'
[30] 'NP_POWER' 'Nord Pool-N2EX Power Prices'
[31] 'COMM3' 'Commodity 3'
[32] 'JACOBSEN' 'The Jacobsen'
[33] 'ISO' 'Independent Systems Operator Data (Genscape)'
[34] 'FAST_RACKS' 'Fast Racks (Racks On Wheels)'
[35] 'COMBINED_FUTURE' 'Combined Future Volume OI'
[36] 'COMBINED_FOPTION' 'Combined FOption Volume OI'
[37] 'ARGUSFC' 'Argus Forward Curve'
[38] 'PETROCHEMWIRE' 'PetroChemWire'
[39] 'FOPTION_IV' 'FOption Implied Volatility'

>> disp(struct2table(data))

id name description
__ __________________ ______________________________________________
1 'EQUITY' 'Equity'
2 'IEOPTION' 'Index/Equity Option'
3 'MUTUAL' 'Mutual Fund'
4 'MONEY' 'Money Market Fund'
5 'BONDS' 'Bond'
6 'INDEX' 'Index'
7 'MKTSTATS' 'Market Statistic'
8 'FUTURE' 'Future'
9 'FOPTION' 'Future Option'
10 'SPREAD' 'Future Spread'
11 'SPOT' 'Spot'
12 'FORWARD' 'Forward'
...

You can narrow-down the results by specifying the Name and/or the Description filtering parameters. For example, let’s display only security types that have ‘Option’ in their Description:

>> struct2table(IQML('lookup', 'DataType','sectypes', 'Description','option'))
ans =
4×3 table
id name description
__ __________________ ____________________________
2 'IEOPTION' 'Index/Equity Option'
9 'FOPTION' 'Future Option'
36 'COMBINED_FOPTION' 'Combined FOption Volume OI'
39 'FOPTION_IV' 'FOption Implied Volatility'

Naturally, it is quite possible that no security types exist that match the requested criteria. In such a case, the result will be empty (and cannot be displayed using Matlab’s struct2table() or struct2cell() functions):

>> data = IQML('lookup', 'DataType','sectypes', 'Name','xyz')
data =
[]

>> struct2cell(data)

Undefined function 'struct2cell' for input arguments of type 'double'.

Here is a summary of the IQML parameters that affect security types lookup:

Parameter

Data type

Default

Description

Name

string

''
(empty string)

Limits the query to secTypes that contain the specified string in their name
(case insensitive, anywhere within the name)

Description

string

''
(empty string)

Limits the query to secTypes that contain the specified string in their description (case insensitive, anywhere within the description)

8.5 SIC codes lookup

To retrieve a list of SIC sectors/industries, set action to 'lookup' and DataType to 'SIC':

>> data = IQML('lookup', 'DataType','SIC')
data =
1009×1 struct array with fields:
id
description

>> data(1)
ans =
id: 111
description: 'WHEAT'

>> data(2)
ans =
id: 112
description: 'RICE'

You can convert the data into a [perhaps] more readable form using Matlab’s builtin struct2cell() and struct2table() functions:

>> disp(struct2cell(data)')

[111] 'WHEAT'
[112] 'RICE'
[115] 'CORN'
[116] 'SOYBEANS'
[119] 'CASH GRAINS, NOT ELSEWHERE CLASSIFIED'
[131] 'COTTON'
[132] 'TOBACCO'
[133] 'SUGARCANE AND SUGAR BEETS'
[134] 'IRISH POTATOES'
[139] 'FIELD CROPS, EXCEPT CASH GRAINS, NOT ELSEWHERE CLASSIFIED'
[161] 'VEGETABLES AND MELONS'
[171] 'BERRY CROPS'
[172] 'GRAPES'
[173] 'TREE NUTS'
[174] 'CITRUS FRUITS'
[175] 'DECIDUOUS TREE FRUITS'
[179] 'FRUITS AND TREE NUTS, NOT ELSEWHERE CLASSIFIED'
...

>> disp(struct2table(data))

id description
___ ___________________________________________________________
111 'WHEAT'
112 'RICE'
115 'CORN'
116 'SOYBEANS'
119 'CASH GRAINS, NOT ELSEWHERE CLASSIFIED'
131 'COTTON'
132 'TOBACCO'
133 'SUGARCANE AND SUGAR BEETS'
134 'IRISH POTATOES'
139 'FIELD CROPS, EXCEPT CASH GRAINS, NOT ELSEWHERE CLASSIFIED'
161 'VEGETABLES AND MELONS'
171 'BERRY CROPS'
172 'GRAPES'
173 'TREE NUTS'
174 'CITRUS FRUITS'
175 'DECIDUOUS TREE FRUITS'
179 'FRUITS AND TREE NUTS, NOT ELSEWHERE CLASSIFIED'
...

You can narrow-down the results by specifying the Description filtering parameter. For example, let’s display only security types that have ‘Oil’ in their Description:

>> struct2table(IQML('lookup', 'DataType','SIC', 'Description','oil'))
ans =
22×2 table
id description
____ ___________________________________________________________________
251 'BROILER, FRYER, AND ROASTER CHICKENS'
711 'SOIL PREPARATION SERVICES'
1381 'DRILLING OIL AND GAS WELLS'
1382 'OIL AND GAS FIELD EXPLORATION SERVICES'
1389 'OIL AND GAS FIELD SERVICES, NOT ELSEWHERE CLASSIFIED'
2074 'COTTONSEED OIL MILLS'
2075 'SOYBEAN OIL MILLS'
2076 'VEGETABLE OIL MILLS, EXCEPT CORN, COTTONSEED, AND SOYBEAN'
2077 'ANIMAL AND MARINE FATS AND OILS'
2079 'SHORTENING, TABLE OILS, MARGARINE, AND OTHER EDIBLE FATS AND OILS'
2673 'PLASTICS, FOIL, AND COATED PAPER BAGS'
2843 'SURFACE ACTIVE AGENTS, FINISHING AGENTS, SULFONATED OILS, AND ASS'
2844 'PERFUMES, COSMETICS, AND OTHER TOILET PREPARATIONS'
2992 'LUBRICATING OILS AND GREASES'
3353 'ALUMINUM SHEET, PLATE, AND FOIL'
3443 'FABRICATED PLATE WORK (BOILER SHOPS)'
3497 'METAL FOIL AND LEAF'
3532 'MINING MACHINERY AND EQUIPMENT, EXCEPT OIL AND GAS FIELD MACHINER'
3533 'OIL AND GAS FIELD MACHINERY AND EQUIPMENT'
3677 'ELECTRONIC COILS, TRANSFORMERS, AND OTHER INDUCTORS'
5983 'FUEL OIL DEALERS'
6792 'OIL ROYALTY TRADERS'

Naturally, it is quite possible that no security types exist that match the requested criteria. In such a case, the result will be empty (and cannot be displayed using Matlab’s struct2table() or struct2cell() functions):

>> data = IQML('lookup', 'DataType','SIC', 'Description','xyz')
data =
[]

>> struct2cell(data)

Undefined function 'struct2cell' for input arguments of type 'double'.

Here is a summary of the IQML parameters that affect SIC codes lookup:

Parameter

Data type

Default

Description

Description

string

''
(empty string)

Limits the query to SIC entries that contain the specified string in their description (case insensitive, anywhere within the description)

warning

Note: IQFeed has a confirmed internal bug as of October 2019: some ~150 SIC codes are not reported, although they have corresponding symbols and are reported by the symbols lookup query (§8.1).130 Symbols having such SIC codes will have an empty SIC_Description field in the fundamental data query (§4.2) and empty SIC_Desc field in the symbols lookup query (§8.1).

8.6 NAICS codes lookup

To retrieve a list of NAICS sectors/industries, set the action to 'lookup' and DataType to 'NAICS':

>> data = IQML('lookup', 'DataType','NAICS')
data =
1175×1 struct array with fields:
id
description

>> data(1)
ans =
id: 111110
description: 'Soybean Farming'

>> data(2)
ans =
id: 111120
description: 'Oilseed (except Soybean) Farming'

You can convert the data into a [perhaps] more readable form using Matlab’s builtin struct2cell() and struct2table() functions:

>> disp(struct2cell(data)')

[111110] 'Soybean Farming'
[111120] 'Oilseed (except Soybean) Farming'
[111130] 'Dry Pea and Bean Farming'
[111140] 'Wheat Farming'
[111150] 'Corn Farming'
[111160] 'Rice Farming'
[111191] 'Oilseed and Grain Combination Farming'
[111199] 'All Other Grain Farming'
[111211] 'Potato Farming'
[111219] 'Other Vegetable (except Potato) and Melon Farming'
[111310] 'Orange Groves'
[111320] 'Citrus (except Orange) Groves'
[111331] 'Apple Orchards'
[111332] 'Grape Vineyards'
[111333] 'Strawberry Farming'
[111334] 'Berry (except Strawberry) Farming'
[111335] 'Tree Nut Farming'
...

>> disp(struct2table(data))

id description
______ ___________________________________________________
111110 'Soybean Farming'
111120 'Oilseed (except Soybean) Farming'
111130 'Dry Pea and Bean Farming'
111140 'Wheat Farming'
111150 'Corn Farming'
111160 'Rice Farming'
111191 'Oilseed and Grain Combination Farming'
111199 'All Other Grain Farming'
111211 'Potato Farming'
111219 'Other Vegetable (except Potato) and Melon Farming'
111310 'Orange Groves'
111320 'Citrus (except Orange) Groves'
111331 'Apple Orchards'
111332 'Grape Vineyards'
111333 'Strawberry Farming'
111334 'Berry (except Strawberry) Farming'
111335 'Tree Nut Farming'
...

You can narrow-down the results by specifying the Description filtering parameter. For example, let’s display only security types that have ‘Oil’ in their Description:

>> struct2table(IQML('lookup', 'DataType','NAICS', 'Description','oil'))
ans =
20×2 table
id description
______ ____________________________________________________________________

111120 'Oilseed (except Soybean) Farming'
111191 'Oilseed and Grain Combination Farming'
112320 'Broilers and Other Meat Type Chicken Production'
115112 'Soil Preparation, Planting, and Cultivating'
213111 'Drilling Oil and Gas Wells'
213112 'Support Activities for Oil and Gas Operations'
237120 'Oil and Gas Pipeline and Related Structures Construction'
311223 'Other Oilseed Processing'
311225 'Fats and Oils Refining and Blending'
322225 'Laminated Aluminum Foil Manufacturing for Flexible Packaging Uses'
324191 'Petroleum Lubricating Oil and Grease Manufacturing'
325620 'Toilet Preparation Manufacturing'
331315 ' Aluminum Sheet, Plate, and Foil Manufacturing'
131
332410 'Power Boiler and Heat Exchanger Manufacturing'
333132 'Oil and Gas Field Machinery and Equipment Manufacturing'
334416 'Electronic Coil, Transformer, and Other Inductor Manufacturing'
423810 'Construction and Mining (except Oil Well) Machinery and Equipment…'
454311 'Heating Oil Dealers'
486110 'Pipeline Transportation of Crude Oil'
811191 'Automotive Oil Change and Lubrication Shops'

Naturally, it is quite possible that no security types exist that match the requested criteria. In such a case, the result will be empty (and cannot be displayed using Matlab’s struct2table() or struct2cell() functions):

>> data = IQML('lookup', 'DataType','NAICS', 'Description','xyz')
data =
[]

>> struct2cell(data)

Undefined function 'struct2cell' for input arguments of type 'double'.

Here is a summary of the IQML parameters that affect NAICS codes lookup:

Parameter

Data type

Default

Description

Description

string

''
(empty string)

Limits the query to NAICS entries that contain the specified string in their description (case insensitive, anywhere within the description)

warning

Note: IQFeed has a confirmed internal bug as of October 2019: some ~150 SIC codes are not reported, although they have corresponding symbols and are reported by the symbols lookup query (§8.1).132 It is possible that a similar bug also applies to NAICS.

8.7 Trade condition codes lookup

To retrieve a list of trade condition codes, set the action to 'lookup' and DataType to 'conditions':

>> data = IQML('lookup', 'DataType','conditions')
data =
155×1 struct array with fields:
id
name
description

>> data(1)
ans =
id: 1
name: 'REGULAR'
description: 'Normal Trade'

>> data(2)
ans =
id: 2
name: 'ACQ'
description: 'Acquisition'

You can convert the data into a [perhaps] more readable form using Matlab’s builtin struct2cell() and struct2table() functions:

>> disp(struct2cell(data)')

[ 1] 'REGULAR' 'Normal Trade'
[ 2] 'ACQ' 'Acquisition'
[ 3] 'CASHM' 'Cash Only Market'
[ 4] 'BUNCHED' 'Bunched Trade'
[ 5] 'AVGPRI' 'Average Price Trade'
[ 6] 'CASH' 'Cash Trade (same day clearing)'
[ 7] 'DIST' 'Distribution'
[ 8] 'NEXTDAY' 'Next Day Market'
[ 9] 'BURSTBSKT' 'Burst Basket Execution'
[10] 'BUNCHEDSOLD' 'Bunched Sold Trade'
[11] 'ORDETAIL' 'Opening/Reopening Trade Detail'
[12] 'INTERDAY' 'Intraday Trade Detail'
[13] 'BSKTONCLOSE' 'Basket Index on Close'
[14] 'RULE127' 'Rule - 127 Trade NYSE'
[15] 'RULE155' 'Rule - 155 Trade AMEX'
[16] 'SOLDLAST' 'Sold Last (late reporting)'
...

>> disp(struct2table(data))

id name description
__ _____________ ________________________________
1 'REGULAR' 'Normal Trade'
2 'ACQ' 'Acquisition'
3 'CASHM' 'Cash Only Market'
4 'BUNCHED' 'Bunched Trade'
5 'AVGPRI' 'Average Price Trade'
6 'CASH' 'Cash Trade (same day clearing)'
7 'DIST' 'Distribution'
8 'NEXTDAY' 'Next Day Market'
9 'BURSTBSKT' 'Burst Basket Execution'
10 'BUNCHEDSOLD' 'Bunched Sold Trade'
11 'ORDETAIL' 'Opening/Reopening Trade Detail'
12 'INTERDAY' 'Intraday Trade Detail'
13 'BSKTONCLOSE' 'Basket Index on Close'
14 'RULE127' 'Rule - 127 Trade NYSE'
15 'RULE155' 'Rule - 155 Trade AMEX'
16 'SOLDLAST' 'Sold Last (late reporting)'
...

You can narrow-down the results by specifying the Name and/or the Description filtering parameters. For example, let’s display only security types that have ‘Option’ in their Description:

>> struct2table(IQML('lookup', 'DataType','conditions', 'Description','option'))
ans =
7×3 table
id name description
__ ______________ ___________________________________________________
39 'SPRD' 'Spread - Trade in Two Options in the Same Class
(a buy and a sell in the same class)'
40 'STDL' 'Straddle - Trade in Two Options in the Same Class
(a buy and a sell in a put and a call)'
43 'BWRT' 'Option Portion of a Buy/Write'
44 'CMBO' 'Combo - Trade in Two Options in the Same Options
Class (a buy and a sell in the same class)'
68 'STKOPT_TRADE' 'Stock-Option Trade'
82 'OPTION_EX' 'Option Exercise'
96 'OPT_ADDON' 'Short Option Add-On'

Naturally, it is quite possible that no security types exist that match the requested criteria. In such a case, the result will be empty (and cannot be displayed using Matlab’s struct2table() or struct2cell() functions):

>> data = IQML('lookup', 'DataType','conditions', 'Name','xyz')
data =
[]

>> struct2cell(data)

Undefined function 'struct2cell' for input arguments of type 'double'.

Note that the trade condition codes are typically reported by IQFeed as a string of one or more 2-digit hexadecimal values.133 For example (see §4.1):

>> data = IQML('quotes', 'Symbol','GOOG')
data =
...
Most_Recent_Trade_Conditions: '3D87'
Trade_Conditions_Description: 'Intramaket Sweep; Odd lot trade'

In this example, the reported last trade had 2 trade conditions: hexadecimal 3D (=61, meaning 'Intramaket Sweep')134 and hexadecimal 87 (=135, meaning 'Odd lot trade').

Here is a summary of the IQML parameters that affect trade conditions lookup:

Parameter

Data type

Default

Description

Name

string

''
(empty string)

Limits the query to trade conditions that contain the specified string in their name
(case insensitive, anywhere within the name)

Description

string

''
(empty string)

Limits the query to trade conditions that contain the specified string in their description (case insensitive, anywhere in the description)


118 In this example, the matching SIC codes were 8331 (HQGE), 8351 (KVIL), 8361 (DRWN, NVOS, SPRV). IQFeed has a bug (as of October 2019): no data is returned if SIC/NAICS < 10 (http://forums.iqfeed.net/index.cfm?page=topic&topicID=5653).

119 The description of the various numeric codes for Market_ID, Sec_Type_ID, SIC and NAICS can be fetched separately – see §8.3-§8.6 below for details

120 IQML can process ~1000 symbols per second; coupled with the network and server-processing latencies we can expect ~4000 symbols to accumulate before the default timeout of 5 seconds kicks in.

121 Note that you can use either Market or Markets as the parameter name, and similarly, either SecType or SecTypes.

122 IQFeed only returns the symbols of active (non-expired) options/futures. See §8.2 below for details about expired contracts.

123 See §8.3 and §8.4 for the list of numeric codes that correspond to each market and security type

124 In IQML, the Market and Markets parameters are synonymous – you can use either of them, in any capitalization

125 In IQML, the SecType and SecTypes parameters are synonymous – you can use either of them, in any capitalization

126 The option contract names in IQFeed use a variant of the OPRA OSI format. See http://www.iqfeed.net/symbolguide/index.cfm?symbolguide=guide&displayaction=support%C2%A7ion=guide&web=iqfeed&guide=options&web=IQFeed&type=stock. Note that the name might change when corporate actions (such as splits) occur, for example: BBD1918A15 vs. BBD11918A15.45 (http://forums.iqfeed.net/index.cfm?page=topic&topicID=5495).

127 ftp://www.dtniq.com/beta/IEOPTION.zip. See http://forums.iqfeed.net/index.cfm?page=topic&topicID=3326 for details.

128 IQFeed officially supports only 0-4, but in practice higher values are accepted, reporting contracts that expire farther out in the future (for example, 2.5 years for SPX). Note: this is undocumented IQFeed behavior, so specifying a value of 5 or higher may possibly not work properly (or at all) in certain cases. See http://forums.iqfeed.net/index.cfm?page=topic&topicID=5508

129 Weekly options are only excluded with IQFeed client 6.1 or newer; binary options are excluded with all clients.

130 http://forums.iqfeed.net/index.cfm?page=topic&topicID=5653

131 The extra space at the beginning of the description here is a typo in IQFeed’s data

132 http://forums.iqfeed.net/index.cfm?page=topic&topicID=5653

133 Trade condition codes 15 or lower are reported with a leading 0, e.g. 05 or 0E. The availability of the codes’ translation in the Trade_Conditions_Description field depends on MsgParsingLevel=2 (which is the default value; see §3.2).

134 The missing “r” in “Intramarket” is a typo in IQFeed’s data