4 Querying the latest market data

4.1 Snapshot (top of book) quotes

We start with a simple example to retrieve the latest market information for Alphabet Inc. Class C, which trades using the GOOG symbol, using IQML’s 'quotes' action:

>> data = IQML('quotes', 'Symbol','GOOG')
data =
Symbol: 'GOOG'
Most_Recent_Trade: 1092.14
Most_Recent_Trade_Size: 1
Most_Recent_Trade_Time: '09:46:31.960276'
Most_Recent_Trade_Market_Center: 25
Total_Volume: 113677
Bid: 1092.13
Bid_Size: 100
Ask: 1092.99
Ask_Size: 100
Open: 1099.22
High: 1099.22
Low: 1092.38
Close: 1090.93
Message_Contents: 'Cbaohlc'
Message_Description: 'Last qualified trade; A bid update
occurred, An ask update occurred; An open
declaration occurred; A high declaration
occurred; A low declaration occurred; A
close declaration occurred'
Most_Recent_Trade_Conditions: '3D87'
Trade_Conditions_Description: 'Intramaket Sweep; Odd lot trade'
Most_Recent_Market_Name: 'Direct Edge A (EDGA)'

As can be seen, the returned data object is a Matlab struct with self-explanatory fields.18 To access any specific field, use the standard Matlab dot-notation:

>> bidPrice = data.Bid; %=1092.13 in this specific case

If the symbol is not currently trading, some fields return empty values:

>> data = IQML('quotes', 'Symbol','GOOG')
data =
Symbol: 'GOOG'
Most_Recent_Trade: 1078.99
Most_Recent_Trade_Size: 1
Most_Recent_Trade_Time: '19:58:47.052099'
Most_Recent_Trade_Market_Center: 26
Total_Volume: 0
Bid: 1077.6
Bid_Size: 100
Ask: 1079.89
Ask_Size: 200
Open: []
High: []
Low: []
Close: 1078.92
Message_Contents: 'Cbav'
Message_Description: 'Last qualified trade; A bid update
occurred; An ask update occurred;
A volume update occurred'
Most_Recent_Trade_Conditions: '0517'
Trade_Conditions_Description: 'Average Price Trade; Form-T Trade'
Most_Recent_Market_Name: 'Direct Edge X (EDGX)'

In this example, the query was sent outside regular trading hours (on Sunday) so Open, High and Low are empty. As expected, the data indicates this was a “Form-T” trade.

Other fields may sometimes be empty. For example, overnight LIBOR rate (Symbol= 'ONLIB.X') reports empty Bid, Ask, Most_Recent_Trade_Size (and Total_Volume=0).

In rare cases, you might see invalid field values (e.g. 0), which may indicate a data error. IQML does not modify the data reported by IQFeed, so if you see this problem consistently for a certain security or exchange, please contact IQFeed’s support.

If you specify an incorrect security name or classification properties, or if you do not have the necessary market subscription, then no data is returned, and an error message is displayed (see discussion in §3.4).

>> IQML('quotes', 'Symbol','xyz123')

Symbol 'XYZ123' was not found!

You may request more than a single snapshot quote: To get the next N real-time quotes, specify the NumOfEvents parameter. The result is an array of structs in the same format as above (or an empty array if no data is available):19

>> data = IQML('quotes', 'Symbol','IBM', 'NumOfEvents',4)
data =
4×1 struct array with fields:
Symbol
Most_Recent_Trade
Most_Recent_Trade_Size
...

>> data(1)
ans =
Symbol: 'IBM'
Most_Recent_Trade: 159.16
Most_Recent_Trade_Size: 75
Most_Recent_Trade_Time: '09:36:15.534201'
Most_Recent_Trade_Market_Center: 24
Total_Volume: 135267
...

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

>> data = IQML('quotes', 'Symbol','IBM', 'NumOfEvents',4)

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

data =
2×1 struct array with fields:
Symbol
Most_Recent_Trade
Most_Recent_Trade_Size
...

To control the maximal duration that IQML will wait for the data, set the Timeout parameter. For example, to wait up to 60 secs to collect the next 4 upcoming quotes:

>> data = IQML('quotes', 'Symbol','IBM', 'NumOfEvents',4, 'timeout',60);

You can request quotes for multiple symbols at the same time, in a single IQML command, by specifying a colon-delimited or cell-array list of symbols. For example:

>> data = IQML('quotes', 'symbols',{'IBM','GOOG','AAPL'});

>> data = IQML('quotes', 'symbols','IBM:GOOG:AAPL'); % equivalent

The result will be an array of Matlab structs that correspond to the requested symbols:

data =
1×3 struct array with fields:
Symbol
Most_Recent_Trade
Most_Recent_Trade_Size
Most_Recent_Trade_Time
Most_Recent_Trade_Market_Center
Total_Volume
Bid
...

>> data(2)
ans =
struct with fields:
Symbol: 'GOOG'
Most_Recent_Trade: 1078.99
Most_Recent_Trade_Size: 1
Most_Recent_Trade_Time: '19:58:47.052099'
Most_Recent_Trade_Market_Center: 26
Total_Volume: 0
Bid: 1077.6
Bid_Size: 100
Ask: 1079.89
Ask_Size: 200
Open: []
High: []
Low: []
Close: 1078.92
Message_Contents: 'Cbav'
Message_Description: 'Last qualified trade; A bid update
occurred; An ask update occurred;
A volume update occurred'
Most_Recent_Trade_Conditions: '0517'
Trade_Conditions_Description: 'Average Price Trade; Form-T Trade'
Most_Recent_Market_Name: 'Direct Edge X (EDGX)'

If you have the Professional license of IQML and also Matlab’s Parallel Computing Toolbox, then setting the UseParallel parameter to true (or 1) will process the quotes query for all the specified symbols in parallel (see discussion in §3.6). Note that in the case of quote queries, there is often little or no speedup in parallelization, because the delay is caused by waiting for market quote events, not due to CPU processing:

>> data = IQML('quotes', 'symbols',{'IBM','GOOG','AAPL'}, 'UseParallel',true);

Note that if you request quotes for a very large number of symbols in a single IQML command, and especially if you set UseParallel to true, you might run into your IQFeed account’s symbols-limit (MaxSymbols; see §9.3). In such a case, IQFeed-generated error messages such as the following will be displayed on the Matlab console:

Warning: Requesting 3258 symbol quotes, which is more than your IQFeed account's concurrent symbols limit (500) - quotes for some symbols may not be available.
(Type "warning off IQML:MaxSymbols" to suppress this warning.)

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

By default, IQFeed reports 16 data fields for each quote: Symbol, Most Recent Trade, Most Recent Trade Size, Most Recent Trade Time, Most Recent Trade Market Center, Total Volume, Bid, Bid Size, Ask, Ask Size, Open, High, Low, Close, Message Contents, and Most Recent Trade Conditions.20

If the Fields parameter is set to an empty value ({} or ''), the current set of fields and the full list of available fields, are reported (in this case, a Symbol parameter is unnecessary):

>> data = IQML('quotes', 'fields',{})
data =
CurrentFields: {1×16 cell}
AvailableFields: {1×68 cell}

>> data.AvailableFields
ans =
1×68 cell array
Columns 1 through 5
{'Symbol'} {'Exchange ID'} {'Last'} {'Change'} {'Percent Change'}
Columns 6 through 11
{'Total Volume'} {'High'} {'Low'} {'Bid'} {'Ask'} {'Bid Size'}
Columns 12 through 17
{'Ask Size'} {'Tick'} {'Range'} {'Open Interest'} {'Open'} {'Close'}
Columns 18 through 22
{'Spread'} {'Settle'} {'Delay'} {'Restricted Code'} {'Net Asset Value'}
...

If you have the Professional (or trial) IQML license, you can request IQFeed to report more than 50 additional data fields, and/or change the reported fields and their order, using the optional Fields parameter, as follows:

We can set Fields to 'All' (or 'all') to request all available data fields in reported quotes:21

>> data = IQML('quotes', 'Symbol','AAPL', 'Fields','all')
data =
Symbol: 'AAPL'
x7_Day_Yield: []
Ask: 222.91
Ask_Change: []
Ask_Market_Center: 28
Ask_Size: 100
Ask_Time: '19:59:42.031900'
Available_Regions: []
Average_Maturity: []
Bid: 222.71
...

The field names in the reported Matlab struct are the same as the IQField field names, except for the following minor changes to create valid Matlab field identifiers:

spaces are replaced by ‘_’ (“Ask Change” à Ask_Change)

‘x’ is prefixed to fields that start with numbers (“7 Day Yield” à x7_Day_Yield)

A complete table of available fields is provided for convenience at the bottom of this section. If you are uncertain about the meaning of a certain field, or wish to know which field reports certain data, please ask your DTN IQFeed representative (after all, IQML just reports the data as provided by IQFeed).

Some of the reported field values may be empty. For example, AAPL’s Average_Maturity value is empty since this field is only valid for bonds. Similarly, EURUSD.FXCM’s Market_Capitalization value is empty because Forex securities have no market cap. Likewise, Net_Asset_Value is only valid for funds. Delay=[] indicates a real-time quote, whereas Delay=15 indicates that the quote was delayed 15 minutes by the exchange (presumably because you do not possess a real-time data subscription for this exchange/security-type).

The Fields parameter can be set to any subset of AvailableFields,22 as either a cell-array of strings, or as a comma-separated string. In this case, any subsequent quotes query will report the requested fields, in the specified order. For example:

>> data = IQML('quotes', 'Symbol','AAPL', 'Fields',{'Bid','Ask','Last'})
>> data = IQML(
'quotes', 'Symbol','AAPL', 'Fields','Bid,Ask,Last') %equivalent
data =
Symbol: 'AAPL'
Bid: 222.71
Ask: 222.91
Last: 222.11

The order of the specified Fields indicates the order in which the data fields will be reported. For example, to change the order of the reported data fields above:

>> data = IQML('quotes', 'Symbol','AAPL', 'Fields','Last,Ask,Bid')
data =
Symbol: 'AAPL'
Last: 222.11
Ask: 222.91
Bid: 222.71

Note that the Symbol field is always reported in the first position, regardless of whether or not it was specified in the Fields list, or of its specified position order in the Fields list (also note the optional spaces between the comma-separated field names):

>> data = IQML('quotes', 'Symbol','AAPL', 'Fields','Bid, Ask, Last, Symbol')
data =
Symbol: 'AAPL'
Bid: 222.71
Ask: 222.91
Last: 222.11

As noted, Fields can be set to any subset of the AvailableFields. If a bad field is specified (one which is not available in IQFeed), an error message will be displayed:

>> data = IQML('quotes', 'Symbol','AAPL', 'Fields','Bid, Ask, xyz')

Error using IQML
Bad field 'xyz' was requested in IQML quotes command (check the
capitalization/spelling).
Available fields are: 7 Day Yield, Ask, Ask Change, Ask Market Center, ...

warningNote: the more fields that you request, the longer the required processing time, by both IQFeed and IQML. To improve run-time performance and reduce latency, request only those data fields that are actually needed by your program.

The following parameters affect quotes data queries:

Parameter

Data type

Default

Description

Symbol or Symbols 23

colon or comma-delimited string, or cell-array of strings

(none)

Limits the query to the specified symbol(s). Examples:

'@VX#'

'IBM:AAPL:GOOG'

'IBM,AAPL,GOOG'

{'IBM', 'AAPL', 'GOOG'}

This parameter must be set to valid symbol name(s). Multiple symbols can be parallelized using the UseParallel parameter (see below).

NumOfEvents

integer

1

Returns up to the specified number of quotes

Timeout

number

5.0

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

UseParallel

logical (true/false)

false

If set to true or 1, and if Parallel Computing Toolbox is installed, then querying multiple symbols will be done in parallel (see §3.6; Professional IQML license only).

Fields

colon or comma-separated string, or cell-array of strings

'Symbol, Most Recent Trade, Most Recent Trade Size, Most Recent Trade Time, Most Recent Trade Market Center, Total Volume, Bid, Bid Size, Ask, Ask Size, Open, High, Low, Close, Message Contents, Most Recent Trade Conditions'

Sets the list of data fields reported by IQFeed for each quote. IQFeed’s default set has 16 fields; 50+ additional fields can be specified (a detailed list of fields is provided below).

If Fields is set to an empty value ({} or ''), the list of current, available fields is returned.

If Fields is not empty, subsequent quotes queries will return the specified fields, in the specified order (Professional IQML license only). The Symbol field is always returned first, even if not specified.

Examples:

'Bid:Ask:Last'

'Bid, Ask, Last'

{'Bid', 'Ask', 'Last'}

'All' (indicates all available fields)

The full list of available fields in IQFeed as of 1/7/2019 is listed below. Note that some of these fields may not be available, and IQFeed may also add/modify this list at any time. The list of fields that are actually available cen be retrieved in IQML using the IQML('quotes','fields',{}) command, as explained above. For details about any of these fields, please contact your DTN/IQFeed representative (IQML just reports the data, it has no control over the reported values or definition of the data fields).

Field Name

Field Type

Description

Data origin 24

7 Day Yield

float

Value of a Money Market fund over past 7 days.

Exchange/other

Ask

float

Min price a market maker/broker accepts for a security.

Exchange/other

Ask Change

float

Change in Ask since last offer.

IQConnect

Ask Market Center

integer

Market Center that sent the ask information (see §8.3).

Exchange/other

Ask Size

integer

The share size available for the ask price

Exchange/other

Ask Time

hh:mm:ss.ffffff

The time of the last ask. May be reported as 99:99:99 outside trading hours to indicate an invalidated quote.25

Exchange/other

Available Regions

string

Dash-delimited list of available regional exchanges.

IQConnect

Average Maturity

float

Average number of days until maturity of a Money Market Fund’s assets.

Exchange/other

Bid

float

Max price a market maker/broker will pay for a security.

Exchange/other

Bid Change

float

Change in Bid since last offer.

IQConnect

Bid Market Center

integer

Market Center that sent the bid information (see §8.3).

Exchange/other

Bid Size

integer

The share size available for the bid price.

Exchange/other

Bid Time

hh:mm:ss.ffffff

The time of the last bid. May be reported as 99:99:99 outside trading hours to indicate an invalidated quote.26

Exchange/other

Change

float

Today's change (Last - Close)

IQConnect

Change From Open

float

Change in last price since last open.

IQConnect

Close

float

The closing price of the day. For commodities this will be the last trade price of the session.

Exchange/other

Close Range 1

float

For commodities only. Range value for closing trades that aren’t reported individually.

Exchange/other

Close Range 2

float

For commodities only. Range value for closing trades that aren’t reported individually.

Exchange/other

Days to Expiration

string

Number of days to contract expiration.

IQConnect

Decimal Precision

string

Last Precision used.

DTN

Delay

integer

The number of minutes a quote is delayed when not authorized for real-time data.

Exchange/other

Exchange ID

hexadecimal

The Exchange Group ID.

DTN

Extended Trade

float

Price of the most recent extended trade (last qualified trades + Form T trades).

Exchange/other

Extended Trade Date

MM/DD/CCYY

Date of the extended trade.

Exchange/other

Extended Trade Market Center

integer

Market Center of the most recent extended trade (last qualified trades + Form T trades); see §8.3.

Exchange/other

Extended Trade Size

integer

Size of the most recent extended trade (last qualified trades + Form T trades).

Exchange/other

Extended Trade Time

hh:mm:ss.ffffff

Time (including microseconds) of the most recent extended trade (last qualified trades + Form T trades).

Exchange/other

Extended Trading Change

float

Extended Trade minus Yesterday's close.

IQConnect

Extended Trading Difference

float

Extended Trade minus Last.

IQConnect

Financial Status Indicator

char

Denotes if an issuer has failed to submit its regulatory filings on a timely basis, has failed to meet the exchange's continuing listing standards and/or filed for bankruptcy. A corresponding description field will be generated by IQML for this field when MsgParsingLevel ≥ 2 (see §3.2)

Exchange/other

Fraction Display Code

string

Display formatting code. A corresponding description field will be generated by IQML for this field when MsgParsingLevel ≥ 2 (see §3.2)

DTN

High

float

Today's highest trade price.

Exchange/other

Last

float

Last trade price from the regular trading session.

Exchange/other

Last Date

MM/DD/CCYY

Date of the last qualified trade.

Exchange/other

Last Market Center

integer

Market Center of most recent last qualified trade.

Exchange/other

Last Size

integer

Size of the most recent last qualified trade.

Exchange/other

Last Time

hh:mm:ss.ffffff

Time (including microseconds) of the most recent last qualified trade.

Exchange/other

Low

float

Today's lowest trade price.

Exchange/other

Market Capitalization

float

Real-time calculated market cap (Last price * Common Shares Outstanding).

IQConnect

Market Open

integer

1 = market open, 0 = market closed.
Note: valid for Futures and Future Options only.

DTN

Message Contents

non-delimited string of single characters of message identification code

Possible single character values include:
C – Last Qualified Trade
E – Extended Trade = Form T trade
O – Other Trade = Any trade not
accounted for by C or E
b – A bid update occurred
a – An ask update occurred
o – An Open occurred
h – A High occurred
l – A Low occurred
c – A Close occurred
s – A Settlement occurred
v – A volume update occurred

Notes: you can get multiple codes in a single message but you will only get one trade identifier per message. It is also possible to receive no codes in a message if the fields that updated were not trade or quote related.

A corresponding description field is generated by IQML for this field when MsgParsingLevel ≥ 2 (see §3.2)

IQConnect

Most Recent Trade

float

Price of most recent trade (inc. non-last-qualified trades).

Exchange/other

Most Recent Trade Aggressor

integer

Identifies if the trade was executed at the bid or the ask price. As of IQFeed 6.1, this feature is only supported for CME and ICE exchanges; unsupported symbols return [].

Possible values:

0 – invalid or unsupported

1 – most recent trade was executed at the Ask price

2 – most recent trade was executed at the Bid price

3 – most recent trade was executed at some other price

[] – unknown or unsupported

(requires IQFeed client 6.1 or newer)

Exchange/other

(only provided by some exchanges)

Most Recent Trade Conditions

string of 2-digit hex numbers

Conditions that identify the type of most recent trade. A corresponding description field is generated by IQML for this field when MsgParsingLevel ≥ 2 (see §3.2, §8.7)

Exchange/other

Most Recent Trade Date

MM/DD/CCYY

Date of most recent trade.

Exchange/other

Most Recent Trade Day Code

integer

The day of month (1-31) in which the most recent trade occurred. (requires IQFeed client 6.1 or newer)

Exchange/other

Most Recent Trade Market Center

integer

Market Center of most recent trade. A corresponding description field will be generated by IQML for this field when MsgParsingLevel ≥ 2 (see §3.2, §8.3)

Exchange/other

Most Recent Trade Size

integer

Size of most recent trade.

Exchange/other

Most Recent Trade Time

hh:mm:ss.ffffff

Time (including microseconds) of most recent trade.

Exchange/other

Net Asset Value

float

The market value of a mutual fund share. Equal to net assets / total number of shares outstanding. Duplicates the Bid field. Valid for Mutual Funds only.

Exchange/other

Number of Trades Today

integer

The number of trades for the current day.

IQConnect/DTN

Open

float

The opening price of the day. For commodities this will be the first trade of the session.

Exchange/other

Open Interest

integer

IEOptions, Futures, FutureOptions, SSFutures only.

Exchange/other

Open Range 1

float

For commodities only. Range value for opening trades that aren’t reported individually.

Exchange/other

Open Range 2

float

For commodities only. Range value for opening trades that aren’t reported individually.

Exchange/other

Percent Change

float

= Change / Close

IQConnect

Percent Off Average Volume

float

Current Total Volume / Average Volume

IQConnect

Previous Day Volume

integer

Previous Day's Volume.

Exchange/other

Price-Earnings Ratio

float

Real-time calculated PE (Last / Earnings Per Share).

IQConnect

Range

float

Trading range for the current day (high - low)

IQConnect

Restricted Code

string

"N"=Short Sale is not restricted, "R"=Restricted.

Exchange/other

Settle

float

Settle price (Futures or FutureOptions only).

Exchange/other

Settlement Date

MM/DD/YYYY

The date that the Settle field is valid for.

Exchange/other

Spread

float

The difference between Bid and Ask prices.

IQConnect

Symbol

string

The symbol name of the security

IQConnect

Tick

integer

173=Up, 175=Down, 183=No Change. Based on the previous trade. Only valid for Last qualified trades.

IQConnect

TickID

integer

Identifier for tick (not necessarily sequential).

DTN

Total Volume

integer

Today's cumulative volume in number of shares.

IQConnect, DTN or exchange

Type

string

“Q”=Update message, “P”=Summary Message.

IQConnect

Volatility

float

Real-time calculated volatility: (High - Low) / Last.

IQConnect

VWAP

float

Volume Weighted Average Price.

IQConnect/DTN

4.2 Fundamental information

Fundamental data on a symbol can be fetched using a 'fundamental' action, as follows:

>> data = IQML('fundamental', 'symbol','IBM')
data =
Symbol: 'IBM'
Exchange_ID: 7
PE: 25.7
Average_Volume: 4588000
x52_Week_High: 180.95
x52_Week_Low: 139.13
Calendar_Year_High: 171.13
Calendar_Year_Low: 144.395
Dividend_Yield: 3.79
Dividend_Amount: 1.5
Dividend_Rate: 6
Pay_Date: '03/10/2018'
Ex_dividend_Date: '02/08/2018'
Short_Interest: 17484332
Current_Year_EPS: 6.17
Next_Year_EPS: []
Five_year_Growth_Percentage: -0.16
Fiscal_Year_End: 12
Company_Name: 'INTERNATIONAL BUSINESS MACHINE'
Root_Option_Symbol: 'IBM'
Percent_Held_By_Institutions: 59.9
Beta: 1.05
Leaps: []
Current_Assets: 49735
Current_Liabilities: 37363
Balance_Sheet_Date: '12/31/2017'
Long_term_Debt: 39837
Common_Shares_Outstanding: 921168
Split_Factor_1: '0.50 05/27/1999'
Split_Factor_2: '0.50 05/28/1997'
Market_Center: []
Format_Code: 14
Precision: 4
SIC: 7373
Historical_Volatility: 25.79
Security_Type: 1
Listed_Market: 7
x52_Week_High_Date: '03/08/2017'
x52_Week_Low_Date: '08/21/2017'
Calendar_Year_High_Date: '01/18/2018'
Calendar_Year_Low_Date: '02/09/2018'
Year_End_Close: 153.42
Maturity_Date: []
Coupon_Rate: []
Expiration_Date: []
Strike_Price: []
NAICS: 541512
Exchange_Root: []
Option_Premium_Multiplier: []
Option_Multiple_Deliverable: []
Session_Open_Time: []
Session_Close_Time: []
Base_Currency: []
Contract_Size: []
Contract_Months: []
Minimum_Tick_Size: []
First_Delivery_Date: []
FIGI: 'BBG000BLNNH6'
Security_SubType: []
Price_Format_Description: 'Four decimal places'
Exchange_Description: 'New York Stock Exchange (NYSE)'
Listed_Market_Description: 'New York Stock Exchange (NYSE)'
Security_Type_Description: 'Equity'
Security_SubType_Description: ''
SIC_Description: 'COMPUTER INTEGRATED SYSTEMS DESIGN'
NAICS_Description: 'Computer Systems Design Services'
SIC_Sector_Name: 'Services'
NAICS_Sector_Name: 'Professional,
Scientific, Technical services'

Notes:

the naming, interpretation and order of returned data fields is controlled by IQFeed, not by IQML – DTN might change these fields in the future.

Splits when only one split is available, Split_Factor_2 will be empty; when no splits are known to IQFeed, both split fields will be empty. Splits are reported as '#.## <mm/dd/yyyy date>', i.e. an American-format date rounded to 2 decimal digits.27 In any case, only the last 2 splits are reported by IQFeed.28

the inclusion of the *_Description fields (Price_Format_Description, Exchange_Description, etc.) depends on the MsgParsingLevel parameter having value of 2 or higher (see §3.2 for details). When MsgParsingLevel is 1 or 0, these fields will not be part of the returned data struct.

Depending on your IQFeed client version, additional fundamental data fields may be returned. For example, the following fields were added in client 6.1 (some fields only have values for certain security types, e.g. futures/options): Session_Open_Time, Session_Close_Time, Base_Currency, Contract_Size, FIGI, Contract_Months, Minimum_Tick_Size, First_Delivery_Date, and Security_SubType. For example, (redacted for clarity):

>> data = IQML('fundamental', 'symbol','@ES#')
data =
struct with fields:
Symbol: '@ES#'
Exchange_ID: 34
PE: []
Average_Volume: []
x52_Week_High: 3006
x52_Week_Low: 2350
...
Company_Name: 'E-MINI S&P 500 SEPTEMBER 2019'
Expiration_Date: '09/20/2019'
Exchange_Root: 'ES'
Session_Open_Time: '18:00:00'
Session_Close_Time: '17:00:00'
Base_Currency: 'USD'
Contract_Size: 50
Contract_Months: '--H--M--U--Z'
Minimum_Tick_Size: 0.25
Underlying_Contract: '@ESU19'
Exchange_Description: 'Chicago Mercantile Exchange (CME)'
Listed_Market_Description: 'Chicago Mercantile Exchange Mini Sized
Contracts (CMEMINI)'
Security_Type_Description: 'Future'

To improve run-time performance, fundamental data is cached in Matlab memory for each symbol. IQFeed is queried for fundamental data for a symbol only if the symbol was not previously queried in the current Matlab session. This is typically a good thing, because fundamental data is relatively stable. To force IQML to re-query IQFeed for fundamental data even when it is cached, set the Debug parameter:

>> data = IQML('fundamental', 'symbol','AAPL', 'debug',true);

>> data = IQML('debug',false); % exit debug mode

It is possible to fetch fundamental data of multiple symbols in a single IQML command, by specifying a colon-delimited or cell-array list of symbols: 29

>> data = IQML('fundamental', 'symbols','AAPL:GOOG') %or: {'AAPL','GOOG'}

data =
1×2 struct array with fields:
Symbol
Exchange_ID
PE
...

>> data(1)
ans =
Symbol: 'AAPL'
Exchange_ID: 5
PE: 20.4
Average_Volume: 26900000
x52_Week_High: 228.87
x52_Week_Low: 149.16
...

>> data(2)
ans =
Symbol: 'GOOG'
Exchange_ID: 5
PE: 51.9
Average_Volume: 1239000
x52_Week_High: 1273.89
x52_Week_Low: 909.7
Calendar_Year_High: 1273.89
...

The list of fundamental data fields in IQFeed as of 1/7/2019 is listed below. Note that IQFeed may modify this list at any time (for example, IQFeed client 6.1 has added several fields). For details about any of these fields, please ask DTN/IQFeed. IQML just reports the data, it has no control over the reported values or definition of data fields. Note that the fundamental data fields cannot be modified, unlike quotes fields.

Field Name

Field Type

Description

Data origin 30

Symbol

string

The Symbol ID to match with watch request

DTN

Exchange ID

hexadecimal

This is the Exchange Group ID (code). Convert to decimal and use the Listed Markets lookup to decode this value.

DTN

PE

float

Price/Earnings ratio

Exchange/other

Average Volume

integer

Average daily volume (4 week average)

DTN

52 Week High

float

Highest price of the last 52 weeks. For futures, this is the contract High.

DTN

52 Week Low

float

Lowest price of the last 52 weeks. For futures, this is the contract Low.

DTN

Calendar year high

float

High price for the current calendar year.

DTN

Calendar year low

float

Low price for the current calendar year.

DTN

Dividend yield

float

The annual dividends per share paid by the company divided by current market price per share of stock, as a % value.

Exchange/other

Dividend amount

float

The current quarter actual dividend

Exchange/other

Dividend rate

float

The annualized dividend expected to be paid by company

Exchange/other

Pay date

MM/DD/YYYY

Date on which a company made its last dividend payment

Exchange/other

Ex-dividend date

MM/DD/YYYY

The actual date in which a stock goes ex-dividend, typically about 3 weeks before the dividend is paid to shareholders of record. The amount of the dividend is reflected in a reduction of the share price on this date.

Exchange/other

Short Interest

integer

Total number of shares of a security that were sold short by customers and securities firms that have not been repurchased to settle outstanding short market positions

3rd party

Current year earnings per share

float

The portion of a company's profit allocated to each outstanding share of common stock

Exchange/other

Next year earnings per share

float

Total amount of earnings per share a company is estimated to accumulate over the next 4 quarters of current fiscal year

Exchange/other

Five-year growth percentage

float

Earnings Per Share growth rate over a five year period

Exchange/other

Fiscal year end

integer

The two-digit month that the fiscal year ends for a company. For example, 4=April.

Exchange/other

Company name

string

Company name or contract description

DTN

Root Option symbol

string

A space separated list (there may be more than one)

Exchange/other

Percent held by institutions

float

A percentage of outstanding shares held by banks and institutions.

Exchange/other

Beta

float

A coefficient measuring a security’s relative volatility:
the covariance of this security’s price in relation to the rest of the market. 30 day historical volatility.

Exchange/other

Leaps (there may be more than one)

string

Long term equity anticipation securities

Exchange/other

Current assets

float

The amount of total current assets held by a company as of a specific date in Millions (lastADate)

Exchange/other

Current liabilities

float

The amount of total current liabilities held by a company as of a specific date in Millions (lastADate).

Exchange/other

Balance sheet date

MM/DD/YYYY

Last date that a company issued their quarterly report.

Exchange/other

Long-term debt

float

The amount of long term debt held by a company as of a specific date in Millions (lastADate).

Exchange/other

Common shares outstanding

float

The amount of common shares outstanding (in thousands).

Exchange/other

Split factor 1

string

A float a space, then MM/DD/YYYY.
For example: '0.5 12/20/2013'

Exchange/other

Split factor 2

string

A float a space, then MM/DD/YYYY.
For example: '0.5 12/20/2013'

Exchange/other

Format Code

string

Display format code

DTN

Precision

integer

Number of decimal digits

DTN

SIC

integer

Standard Industrial Classification – a 4-digit federal code that identifies the security’s specific industry.

Exchange/other

Historical Volatility

float

30-trading day volatility, calculated using Black-Scholes

DTN

Security Type

string

The security type code

DTN

Listed Market

string

The listing market ID

DTN

52 Week High Date

MM/DD/YYYY

The date of the highest price of the last 52 weeks. For futures, this is the contract High Date.

DTN

52 Week Low Date

MM/DD/YYYY

The date of the lowest price of the last 52 weeks. For futures, this is the contract Low Date.

DTN

Calendar Year High Date

MM/DD/YYYY

Date at which the High price for the current calendar year occurred.

DTN

Calendar Year Low Date

MM/DD/YYYY

Date at which the Low price for the current calendar year occurred.

DTN

Year End Close

float

Price of Year End Close (Equities Only)

DTN

Maturity Date

MM/DD/YYYY

Date of maturity for a Bond.

DTN

Coupon Rate

float

Interest Rate for a Bond.

Exchange/other

Expiration Date

MM/DD/YYYY

IEOptions, Futures, FutureOptions, and SSFutures only

IEOptions by the exchange;
others by DTN

Strike Price

float

IEOptions only

Exchange/other

NAICS

integer

North American Industry Classification System code 31

3rd party

Exchange Root

string

The root symbol under which this symbol is listed at the exchange.

Exchange

Options Premium Multiplier

float

IEOptions only

3rd party

Options Multiple Deliverables

integer

IEOptions only. 1 means they exist, 0 means they do not.

3rd party

Session Open Time

hh:mm:ss

Futures and Future Options Only (IQFeed 6.1 or newer)

3rd party

Session Close Time

hh:mm:ss

Futures and Future Options Only (IQFeed 6.1 or newer)

3rd party

Base Currency

string

Futures and Future Options Only (IQFeed 6.1 or newer)

3rd party

Contract Size

string

Deliverable quantitiy of a future or option contract. (IQFeed 6.1 or newer)

3rd party

Contract Months

string

non-delimited string of upper-case single character month codes (IQFeed 6.1 or newer)

3rd party

Minimum Tick Size

float

Minimum price movement. (IQFeed 6.1 or newer)

3rd party

First Delivery Date

MM/DD/YYYY

Futures and Future Options Only (IQFeed 6.1 or newer)

3rd party

FIGI

string

Financial Instrument Global Identifier 32 (IQFeed 6.1 or newer). For example: 'BBG000BLNNH6' (IBM)

3rd party

Security SubType

integer

The security’s SubType code (IQFeed 6.1 or newer).
1=Binary option, 2=weekly option, 3=ETF, []=other

DTN

Underlying Contract

string

The specific future contract that underlies a continuous future. For example, for @ES# this might be '@ESU19' 33

IQML

4.3 Interval bars

Interval bars data for one or more symbols can be fetched using the 'intervalbars' action. For example, to fetch the latest 60-second interval bar for the current E-Mini contract:

>> data = IQML('intervalbars', 'Symbol','@ES#')
data =
Symbol: '@ES#'
BarType: 'Complete interval bar from history'
Timestamp: '2018-09-05 12:57:00'
Open: 2887.75
High: 2888.25
Low: 2887.5
Close: 2888.25
CummlativeVolume: 1117565
IntervalVolume: 913
NumberOfTrades: 0

In the returned data struct, we can see the following fields:

Symbol – the requested Symbol.

BarType – typically ‘Complete interval bar from history’, but in some cases might be ‘Complete interval bar from stream’ or ‘Updated interval bar’.

Timestamp – server timestamp (string format) for this interval bar. The timestamp is of the end of the bar, not the beginning.

Open – price at the start of this interval bar.

High – highest price during this interval bar.

Low – lowest price during this interval bar.

Close – price at the end of this interval bar.

CummlativeVolume – total trade volume since start of the current trading day.

IntervalVolume – trade volume during this interval bar.

NumberOfTrades – number of trades during this interval bar. Relevant only when IntervalType is set to 'ticks'/'trades'.

The IntervalType (default: 'secs') and IntervalSize (default: 60) parameters should typically be specified together. Note that IntervalSize must be a positive integer value (i.e. its value cannot be 4.5 or 0). If IntervalType is 'ticks'/'trades', IntervalSize must be 2 or higher. If IntervalType is 'volume', IntervalSize must be 100 or higher. If IntervalType is 'secs', IntervalSize must be any integer between 1-300 (5 minutes), or any multiple of 60 (1 minute) between 300-3600 (1 hour), or 7200 (2 hours).34

We can ask for multiple bars by setting NumOfEvents or MaxItems to a positive integer, resulting in an array of structs in the format above (empty array if no data is available):

>> data = IQML('intervalbars', 'Symbol','@VX#', 'NumOfEvents',4)
data =
4×1 struct array with fields:
Symbol
BarType
...

>> data(1)
ans =
Symbol: '@VX#'
BarType: 'Complete interval bar from history'
Timestamp: '2018-09-05 12:36:00'
Open: 14.45
High: 14.5
Low: 14.45
Close: 14.45
CummlativeVolume: 57077
IntervalVolume: 17
NumberOfTrades: 0

IQFeed only returns interval bars that had market ‘action’. Other bars are not sent from IQFeed – they will appear in IQML’s returned data as gaps in the Timestamp.

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

>> data = IQML('intervalbars', 'Symbol','IBM', 'NumOfEvents',4)

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

data =
2×1 struct array with fields:
Symbol
BarType
...

To control the maximal duration that IQML will wait for the data, set the Timeout parameter. For example, to wait up to 60 secs to collect 4 bars:

>> data = IQML('intervalbars', 'Symbol','IBM', 'NumOfEvents',4, 'timeout',60);

Interval bars query fetches historical bars data, starting from the date/time that is set by the BeginDateTime parameter (see the parameters table below). This is similar to (and subject to the same limitations as) fetching historical interval data (see §5.4), but with no specified end point. IQML will return both the historical bars, as well as new (live) real-time streaming interval bars, as they become available. BeginDateTime’s default value is 00:00:00 today (server time), so you will almost always get historical bars before live streaming bars. If you run the query at mid-day, you may get hundreds of historical bars before you get the first live streaming bar. So, if you set NumOfEvents to a low value, you might receive only historical bars, without any live streaming bars.

Unlike quotes (§4.1), when you specify NumOfEvents > 1, IQML does not wait for new bars to arrive; instead, it returns previous (historic) bars, as long as this does not conflict with the specified BeginDateTime. For example, if you set NumOfEvents=5, you will receive the latest 5 bars: 4 complete historic bars, as well as the current (incomplete) bar. If you require live (future) interval bars, then set BeginDateTime, or use the streaming mechanism that is described in §6.3. For example, if you set BeginDateTime to 5 bars ago and NumOfEvents=15, then IQFeed will return the 5 historic bars and wait for 10 additional future bars (subject to the specified Timeout).

Additional data filtering parameters: MaxDays, BeginFilterTime and EndFilterTime.

You can query multiple symbols at the same time, in a single IQML command, by specifying a colon-delimited or cell-array list of symbols. For example:

>> data = IQML('intervalbars', 'symbols',{'IBM','GOOG','AAPL'});

>> data = IQML('intervalbars', 'symbols','IBM:GOOG:AAPL'); % equivalent

If the query returns the same number of data elements for all symbols, the results will be returned as a struct array, with columns corresponding to the requested symbols:

data =
100×3 struct array with fields:
Symbol
BarType
Timestamp
Open
High
Low
Close
CummlativeVolume
IntervalVolume
NumberOfTrades

However, if IQML returns a different amount of data for various symbols, the results are returned as a cell array, with cell elements corresponding to the requested symbols. For example, in the following query, there is no symbol ‘XXX’ so IQML returns empty results for this particular symbol:35

>> data = IQML('intervalbars', 'Symbol','IBM:GOOG:XXX', 'UseParallel',true)
data =
1×3 cell array
{100×1 struct} {100×1 struct} {0×0 double}

If you have the Professional license of IQML and also Matlab’s Parallel Computing Toolbox, then setting the UseParallel parameter to true (or 1) will process the quotes query for all the specified symbols in parallel (see discussion in §3.6):

>> data = IQML('intervalbars', 'symbols',{'IBM','GOOG','AAPL'}, ...
'UseParallel',1);

The following parameters affect interval bars data queries:

Parameter

Data type

Default

Description

Symbol or Symbols 36

colon or comma-delimited string or cell-array of strings

(none)

Limits the request to the specified symbol(s). Examples:

'@VX#'

'IBM:AAPL:GOOG'

'IBM,AAPL,GOOG'

{'IBM', 'AAPL', 'GOOG'}

This parameter must be set to valid symbol name(s) when NumOfEvents>0. Multiple symbols can be parallelized using the UseParallel parameter (see below).

UseParallel

logical (true/false)

false

If set to true or 1, and if Parallel Computing Toolbox is installed, then querying multiple symbols will be done in parallel (see §3.6; Professional IQML license only).

NumOfEvents

integer

Inf

One of:

inf – continuous endless streaming interval bars for specified symbol(s)

N>1 – stream only N interval bars

1 – get only a single interval bar

0 – stop streaming interval bars

-1 – return latest interval bars data while continuing to stream new bars

MaxItems

integer

100

Returns up to the specified number of bars (if available).

MaxDays

integer

1

Max number of trading days to retrieve

IntervalType

string

'secs'

Sets the type of interval size. One of the following values:

's' or 'secs' – time [seconds] (default)

'v' or 'volume' – traded volume

't' or 'ticks' – number of ticks

IntervalSize

integer

60

Size of bars in IntervalType units. Must be ≥1 for secs, ≥2 for ticks, ≥100 for volume.

BeginFilterTime

string

'00:00:00'

Only return bars that begin after this time of day (US Eastern time-zone). Format: 'hhmm', 'hh:mm', 'hhmmss' or 'hh:mm:ss'.

EndFilterTime

string

'23:59:59'

Only return bars that end before this time of day (US Eastern time-zone). Format: 'hhmm', 'hh:mm', 'hhmmss' or 'hh:mm:ss'.

BeginDateTime

integer or string or datetime object

''
(empty string) meaning today at 00:00:00

Only return bars that begin after this date/time (US Eastern time-zone).
Format: Matlab datenum, 'yyyymmdd hhmmss' or 'yyyy-mm-dd hh:mm:ss'.

Timeout

number

5.0

Max number of seconds to wait (0-9000) for data in blocking mode (0 means infinite)

4.4 Market depth (Level 2)

Level 2 (II) market data on a symbol can be fetched using a 'marketdepth' action. Deep order-book rows (market depth) are reported for futures, and the top Bid/Ask for each separate market maker (market width) are reported for equities.37 For example:

>> data = IQML('marketdepth', 'symbol','@ES#')
data =
10×1 struct array with fields:
Symbol
ID
Bid
Ask
BidSize
AskSize
BidTime
Date
AskTime
BidInfoValid
AskInfoValid
Condition
Condition_Description
ID_Description

The latest data (i.e., state of the market-depth table) is returned as a Matlab struct array, whose elements correspond to the market-depth rows. For example, to see the data for row #3 (i.e., 2 rows below the top-of-book row), you can access array element #3:

>> data(3)
ans =
struct with fields:
Symbol: '@ES#'
ID: 'MD03'
Bid: 2926.75
Ask: 2928
BidSize: 94
AskSize: 129
BidTime: '03:21:15.037291'
Date: '2019-05-02'
AskTime: '03:21:19.064197'
BidInfoValid: 1
AskInfoValid: 1
Condition: 52
Condition_Description: 'regular'
ID_Description: 'Order book row #3'

BidInfoValid and AskInfoValid values are logical (true/false) values, which appear as 1 or 0, respectively, in the struct display above. The ID field ('MD03' in this case) indicates this is market-depth row 3 (also note the related ID_Description field).

Each incoming market depth message provides information on a single Level 2 data row. IQFeed’s messages arrive at a random, unsorted, unpredictable order in two groups: first the messages that define the current (snapshot) baseline of all rows, then update messages for individual rows when traders place, cancel or modify their orders.

Depending on the requested Symbol, IQFeed may report 5 to 15 market-depth rows. To ensure that all the baseline data rows are received, set the NumOfEvents parameter to at least the total number of rows expected for the Symbol. For example:

>> data = IQML('marketdepth', 'symbol','@ES#', 'NumOfEvents',15)
data =
10×1 struct array with fields:
Symbol
ID
Bid
Ask
BidSize
AskSize
...

The returned struct array can be converted into a Matlab table object, as follows:38

>> struct2table(data)
ans =
10×14 table
Symbol ID Bid Ask BidSize AskSize BidTime ...
______ ______ _______ _______ _______ _______ _________________
'@ES#' 'MD01' 2927.25 2927.5 58 121 '03:21:25.213504'
'@ES#' 'MD02' 2927 2927.75 78 111 '03:21:22.040253'
'@ES#' 'MD03' 2926.75 2928 94 129 '03:21:15.037291'
'@ES#' 'MD04' 2926.5 2928.25 95 107 '03:21:04.023779'
'@ES#' 'MD05' 2926.5 2928.75 104 184 '03:42:19.025285'
'@ES#' 'MD06' 2926.25 2929 123 181 '03:42:43.020801'
'@ES#' 'MD07' 2926 2929.25 137 127 '03:43:01.042949'
'@ES#' 'MD08' 2925.75 2929.5 86 135 '03:42:01.029094'
'@ES#' 'MD09' 2925.5 2929.75 183 161 '03:42:02.021818'
'@ES#' 'MD10' 2925.25 2930 152 382 '03:42:07.003202'

For equities, IQFeed returns market width (not depth) data – the top bid/ask row (but not order-book depth) for each market maker that trades the equity. For example:

>> data = IQML('marketdepth', 'symbol','MSFT', 'NumOfEvents',50)
data =
4×1 struct array with fields:
Symbol
ID
Bid
Ask
...

>> data(1)
ans =
struct with fields:
Symbol: 'MSFT'
ID: 'BATS'
Bid: 0
Ask: 129.39
BidSize: 0
AskSize: 600
BidTime: '18:29:49.000347'
Date: '2019-05-01'
AskTime: '99:99:99.000000'
BidInfoValid: 0
AskInfoValid: 1
Condition: 52
Condition_Description: 'regular'
ID_Description: 'CBOE TRADING, INC.'

>> data(2)
ans =
struct with fields:
Symbol: 'MSFT'
ID: 'NSDQ'
Bid: 127.91
Ask: 130.09
BidSize: 100
AskSize: 100
BidTime: '04:03:41.004392'
Date: '2019-05-02'
AskTime: '04:17:07.020285'
BidInfoValid: 1
AskInfoValid: 1
Condition: 52
Condition_Description: 'regular'
ID_Description: 'Nasdaq Execution Services'

>> struct2table(data2)
ans =
4×14 table
Symbol ID Bid Ask BidSize AskSize BidTime Date ...
______ ______ ______ _______ _______ _______ _________________ ____________
'MSFT' 'BATS' 0 129.39 0 600 '18:29:49.000347' '2019-05-01'
'MSFT' 'NSDQ' 127.91 130.09 100 100 '04:03:41.004392' '2019-05-02'
'MSFT' 'EDGX' 127.54 127.98 200 4800 '19:53:35.049950' '2019-05-01'
'MSFT' 'ARCX' 127.97 128.71 100 100 '04:17:13.037004' '2019-05-02'

In this example, which was ran outside regular trading hours (early morning of 2019-05-02), BATS reported a valid Ask from the previous evening, but no valid Bid.39 The other market makers (NSDQ, EDGX and ARCX) reported both valid Bid and Ask.

Note that the reported market-maker rows are not sorted. Depending on the time of your query, you may receive a different set of market-makers: market makers who do not have any valid Bid/Ask are not reported.40 Depending on the specific equity and request time, you may receive between 0 and dozens of market maker rows.

Using the reported Level 2 data from different market makers enables arbitrage trading: buying a security from market maker A (who offers the lowest Ask price) and selling to market maker B (who offers the highest Bid price).

If you wish to receive Level 2 quotes even when they are empty (invalid Bid and Ask), set the IncludeEmptyQuotes parameter to true or 1 (default value: false). For example:

>> struct2table(IQML('marketdepth','symbol','MSFT','IncludeEmptyQuotes',1, ...
'NumOfEvents'
,70))
ans =
67×14 table
Symbol ID Bid Ask BidSize AskSize BidTime Date ...
______ ______ ______ _______ _______ _______ _________________ ____________
'MSFT' 'SDLR' 0 0 0 0 '99:99:99.000000' '2019-05-01'
'MSFT' 'STXG' 0 0 0 0 '99:99:99.000000' '2019-05-01'
'MSFT' 'BATS' 0 129.39 0 600 '18:29:49.000347' '2019-05-01'
'MSFT' 'NSDQ' 127.91 130.09 100 100 '04:03:41.004392' '2019-05-02'
...

If your IQFeed account is not authorized/subscribed for Level 2 data, you will receive an error message whenever you request market depth data:41

Account not authorized for Level II

If your IQFeed account is authorized for Level 2 data but not for a certain exchange, you will receive an error message when requesting market depth info from that exchange:

>> data = IQML('marketdepth', 'Symbol','IBM') % not subscribed to NYSE Level2

Error using IQML
Symbol 'IBM' was not found!

The following parameters affect market depth data queries:

Parameter

Data type

Default

Description

Symbol or Symbols 42

colon or comma-delimited string, or cell-array of strings

(none)

Limits the request to the specified symbol(s). Examples:

'@ES#'

'IBM:AAPL:GOOG'

'IBM,AAPL,GOOG'

{'IBM', 'AAPL', 'GOOG'}

This parameter must be set to valid symbol name(s) when NumOfEvents>0

NumOfEvents

integer

10 43

One of:

inf – continuous endless streaming Level 2 data for specified symbol(s)

N>1 – only process N incoming quotes

1 – get only a single quote

0 – stop streaming market depth data

-1 – return the latest Level 2 data while continuing to stream new data updates

IncludeEmptyQuotes

logical (true/false)

false

If set to true or 1, empty Level 2 quotes (with neither a valid Bid nor valid Ask) will also be returned. By default (false), they will not be.

Timeout

number

5.0

Max number of seconds to wait (0-9000) for data in blocking mode (0 means infinite)

warningNote: Market Depth (Level 2) data is only available in the Professional IQML license.

4.5 Greeks, fair value, and implied volatility

Extra data can be fetched (calculated) for asset options using the 'greeks' action:

Greeks (Delta, Vega, Theta, Rho, Gamma etc.)

Fair value for the derivative and the difference vs. actual trading price

Implied volatility based on the fair vs. trading prices

>> data = IQML('greeks', 'symbol','IBM1814L116')
data =
Symbol: 'IBM1814L116'
Asset_Name: 'IBM DEC 2018 C 116.00'
Strike_Price: 116
Expiration_Date: '12/14/2018'
Days_To_Expiration: 30
Inferred_Asset_Side: 'Call'
Underlying_Symbol: 'IBM'
Underlying_Asset_Name: 'INTERNATIONAL BUSINESS MACHINE'
Underlying_Spot: 121.3
Underlying_Historic_Volatility: 37.1
Assumed_Risk_Free_Rate: 0
Assumed_Dividend_Yield: 0
Asset_Fair_Value: 8.1193
Asset_Latest_Price: 7.05
Asset_Price_Diff: 1.0693
Implied_Volatility: 0.28242
Delta: 0.68197
Vega: 0.12404
Theta: -0.076697
Rho: 6.1318
CRho: 6.7992
Omega: 10.189
Lambda: 10.189
Gamma: 0.027646
Vanna: -0.3527
Charm: 0.0021809
Vomma: 5.8043
Veta: 2.4262
Speed: -0.0012419
Zomma: -0.061581
Color: -0.00038078
Ultima: -45.238
Annual_Factor_Used: 365
This_Asset_Latest_Quote: [1×1 struct]
Underlying_Latest_Quote: [1×1 struct]
This_Asset_Fundamentals: [1×1 struct]
Underlying_Fundamentals: [1×1 struct]

The results are reported in a Matlab struct: the first few fields provide basic information on the derivative asset and its underlying security, followed by fair-value information, implied volatility and a long list of Greek values.

At the bottom of the returned data-struct, four sub-structs provide direct access to the latest quotes (§4.1, for example data.This_Asset_Latest_Quote.Total_Volume) and fundamenta data (§4.2, for example, data.Underlying_Fundamentals.Average_Volume) for both the option asset and its underlying stock.

The following Greek values are reported by IQML:

Field

Symbol

Derivative order

Definition

Description

Delta

Δ

1

∂V/∂S

Sensitivity of fair value to changes in the underlying asset’s spot price

Vega

ν

1

∂V/∂σ

Sensitivity of fair value to changes in the underlying asset’s volatility; also called Kappa

Theta

Θ

1

-∂V/∂τ

Sensitivity of fair value to maturity time (decay)

Rho

ρ

1

∂V/∂r

Sensitivity of fair value to risk-free rate

CRho

-

1

∂V/∂b

Sensitivity of fair value to the carry-rate

Omega, Lambda

Ω
λ

1

Δ × S/V

% change in fair value due to a 1% change in the underlying asset price (these are synonym fields, both are reported for convenience)

Gamma

Γ

2

∂Δ/∂S

Sensitivity of Delta to changes in the underlying asset’s spot price

Vanna

-

2

∂Δ/∂σ

Sensitivity of Delta to changes in the underlying asset’s volatility

Charm

-

2

-∂Δ/∂τ

Sensitivity of Delta to maturity time (decay)

Vomma

-

2

ν/∂σ

Sensitivity of Vega to changes in underlying asset’s volatility; also sometimes called Volga

Veta

-

2

ν/∂τ

Sensitivity of Vega to the maturity time

Speed

-

3

∂Γ/∂S

Sensitivity of Gamma to changes in the underlying asset’s spot price

Zomma

-

3

∂Γ/∂σ

Sensitivity of Gamma to changes in the underlying asset’s volatility

Color

-

3

∂Γ/∂τ

Sensitivity of Gamma to maturity time (decay)

Ultima

-

3

3V/∂σ3

Sensitivity of Vomma (Volga) to changes in the underlying asset’s volatility

You can request data for multiple symbols at the same time, in a single IQML command, by specifying the symbols using a colon-delimited string or a cell-array. For example:

>> data = IQML('greeks', 'symbols',{'IBM1814L116','IBM1814X116'});

>> data = IQML('greeks', 'symbols','IBM1814L116:IBM1814X116'); % equivalent

The result will be an array of Matlab structs that correspond to the requested symbols:

data =
2×1 struct array with fields:
Symbol
Asset_Name
Strike_Price
...

If you have Matlab’s Parallel Computing Toolbox, set the UseParallel parameter to true (or 1) to process the Greeks query for the specified symbols in parallel (see §3.6):

>> data = IQML('greeks', 'symbols',{'IBM1814L116','IBM1814X116'}, ...
'UseParallel',true);

warningNotes:

Greeks and related derivative data (the the 'greeks' action in general) are only available in IQML Professional and trial licenses, not in the Standard license.

Greeks, fair-price and implied vol values are computed by IQML on your local computer. They are NOT provided by IQFeed, and are NOT approved by DTN.

There’s a performance impact: the calculations require some data fetches from IQFeed. These extra fetches and calculations may take up to 0.3-1 secs per query, depending on CPU, IQFeed round-trip latency, and the specific parameters.

The calculations assume vanilla European-style options using Black-Scholes-Merton’s model.44 Using IQML’s calculations with other derivatives (American/ Asian/barrier/exotic options etc.) may result in incorrect/misleading values.

There are various possible ways to estimate implied volatility from the option’s trading price and fair value. IQML uses a standard Newton-Raphson iterative approximation method; other methods may result in slightly different values.

Certain fields sometimes report invalid values. For example, Implied_Volatility may contain –Inf or +Inf when the Newton-Raphson algorithm fails to converge to a valid value. Likewise, some Greeks may contain a NaN value in certain cases (for example, a contract so far out-of-the-money that it has no trading price).

Some Greeks are also known by other names: Vega is sometimes called Kappa; Vomma is also known as Volga or vega convexity; Omega is also called Lambda or elasticity; Charm is also known as delta decay; and Color as gamma decay.

Various sources/systems calculate Greeks in different manners. For example, Vega, Rho, Veta and Ultima values are sometimes divided by 100 (but not in IQML); Theta, Charm, Veta and Color are sometimes annualized and sometimes divided by a representative number of days per year (365/364/360/253/252) to provide 1-day estimates (customizable in IQML, 365 by default);45 The foreign rate/dividends yield is ignored by some sources and included by others in the calculations; Some sources report Color as the positive rate of change of Gamma relative to maturity time, while others report it as the negative rate of change.46 In addition, some sources apparently have buggy math implementations.47 The result is that different sources provide different Greek values for the same inputs. IQML’s values are basically identical to those of Matlab’s Financial Toolbox, NAG and Maple.48 Unfortunately, IQFeed’s standalone Option Chains utility reports different values. IQML adheres to the core math formulae49 and we believe that IQML provides mathematically-accurate results. However, the discrepancy between the values reported by different systems means that you must carefully ensure that IQML’s reported values fit your needs and expectations.

By default, IQML uses the derivative’s fundamental data and default 0% rates in its calculations. You can override these defaults using the following optional parameters:

UnderlyingSymbol – by default this is the Asset_Name’s first string token, or the first portion of Symbol. For example, for IBM1814L116, Asset_Name='IBM DEC 2018 C 116.00' so Underlying_Symbol is set to 'IBM' (the first token in the Asset_Name); for @BOF20P28500 the Underlying_Symbol is set to '@BOF20' (Soybean Oil Jan 2020 Future).50 To check the auto-inferred UnderlyingSymbol, check the Underlying_Asset_Name field in the returned data. The Underlying_Symbol value can be overrriden using the UnderlyingSymbol parameter. For example, you could specify that the underlying symbol for Greeks computation of GOOG1816K1000 is not the default 'GOOG' (Alphabet Inc Class C), but rather 'GOOGL' (Class A).

Side – by default, the option side ('Call' or 'Put') is determined by IQML from the derivative contract’s Asset_Name. For example, for IBM1814L116, Asset_Name='IBM DEC 2018 C 116.00', which is automatically inferred to be a Call option. You can override the inferred side for contracts that have a non-standard Asset_Name (or one which is not properly reported by IQFeed in its Fundamental Data message) that IQML cannot properly analyze.

HistoricVolatility – this is usually reported by IQFeed in the underlying asset’s fundamental data (data.Underlying_Fundamentals.Historical_Volatility) and this is used in IQML by default. Instead of this reported value, you can specify another value (for example, the S&P 500 volatility), as a fixed percent value.

RiskFreeRate this is the domestic risk-free rate. IQML uses 0% by default; you can specify any other fixed percentage rate (based on e.g. LIBOR51 or T-bill52).

DividendsYield – this is the underlying asset’s dividend yield. IQML uses 0% by default; you can specify any other fixed percentage value. In the context of Forex currencies, this value may represent the foreign risk-free (carry) rate.

DaysToExpiration – by default, IQML determines the number of days until contract expiration (maturity) based on the contract’s reported Expiration_Date. This maturity time can be overridden to any positive value. Note that the value is specified in days (not necessarily integer), not years.

AnnualFactor – by default, IQML normalizes the reported Theta, Charm, Veta and Color values by dividing the computed annualized value by 365 in order to provide 1-day estimates. You can override this scaling factor to any positive number. Setting a value of 1 provides annualized results (i.e., not 1-day estimates), as reported by Matlab’s Financial Toolbox, NAG and Maple. For various uses you could also use other factors such as 364, 360, 253, 252, 12 or 4.

Here is a usage example with some non-default parameters:

>> data = IQML('greeks', 'symbol','IBM1814L116', 'DaysToExpiration',13.5, ...
'RiskFreeRate',2.5, 'DividendsYield',3.2, 'AnnualFactor',1)

The following parameters affect Greeks data queries:

Parameter

Data type

Default

Description

Symbol or Symbols 53

colon-delimited string, or cell-array of strings

(none)

Limits the query to the specified symbol(s). Examples:

'GOOG1816K1000'

'IBM1814L116:GOOG1816K1000'

{'IBM1814L116', 'GOOG1816K1000'}

This parameter must be set to valid symbol name(s). Multiple symbols can be parallelized using the UseParallel parameter (see below).

UseParallel

logical (true/false)

false

If set to true or 1, and if Parallel Computing Toolbox is installed, then querying multiple symbols will be done in parallel (see §3.6).

UnderlyingSymbol

string

'' (i.e. taken from the contract name)

Symbol of the derivative’s underlying asset

Side

string

'' (i.e. taken from the contract name)

Either 'Call' or 'Put'

HistoricVolatility

number

-1 (i.e. taken from the underlying asset’s reported historic volatility)

Value that represents the underlying’s price volatility (in percent). 1.0 means 1%;
-1 means a dynamic value based on the underlying asset’s reported historic volatility.

RiskFreeRate

number

0.0

Domestic risk-free rate
Specified in percent; 1.0 means 1%.

DividendsYield

number

0.0

Underlying stock’s dividends yield, or the foreign currency risk-free (carry) rate.
Specified in percent; 1.0 means 1%.

DaysToExpiration

number

-1 (i.e. taken from the contract’s expiration date)

Number of days until the contract expires (matures)

AnnualFactor

number

365

The computed Theta, Charm, Veta and Color values are divided by this factor before being reported. Typical values are 365, 364, 360, 253, 252, 12, 4 or 1.

warningNote: The Greeks functionality is only available in the Professional and trial IQML licenses, not in the Standard license.

4.6 Market summary data and scanner

All the queries described so far in this chapter return data for individually-specified Symbols. We can retrieve a complete market snapshot of all traded securities of a specific SecType and Exchange, using a 'summary' query:

>> data = IQML('summary') % latest 5-minute data for all NYSE equities
data =
4749×1 struct array with fields:
Symbol
Exchange
Type
Last
TradeSize
TradedMarket
TradeDate
TradeTime
Open
High
Low
Close
...
(total of 28 data fields)

>> data(1)
ans =
struct with fields:
Symbol: 'A'
Exchange: 7
Type: 1
Last: 72.5315
TradeSize: 5
TradedMarket: 5
TradeDate: 20190711
TradeTime: 103502
Open: 73.77
High: 73.78
Low: 72.5315
Close: 73.37
Bid: 72.51
BidMarket: 18
BidSize: 200
Ask: 72.54
AskMarket: 5
AskSize: 100
Volume: 257497
PDayVolume: 1785225
UpVolume: 84799
DownVolume: 80276
NeutralVolume: 92422
TradeCount: 2371
UpTrades: 733
DownTrades: 832
NeutralTrades: 806
VWAP: 73.1309

This query shows that 4749 equities are currently trading on NYSE.54 This data is daily (i.e., the cummulative day’s Open/High/Low/Volume etc.), and is updated on IQFeed’s servers every 5 minutes. DTN says that “the timing of the snapshot is not guaranteed, but data will be gathered every 5 minutes”. Therefore, you should assume for safety that the data is up to 5 minutes old. To get the latest data, use real-time snapshot (§4.1) and fundamental (§4.2) queries, or streaming quotes (§6.1).

The default DataType parameter value ('snapshot') fetches trading data. To fetch a market summary of fundamental data, set DataType='fundamental'. For example:

>> data = IQML('summary', 'DataType','fundamental')
data =
4749×1 struct array with fields:
Symbol
Description
PeRatio
AvgVolume
...
(total of 41 data fields)

>> data(1)
ans =
struct with fields:
Symbol: 'A'
Description: 'AGILENT TECHNOLOGIES'
PeRatio: 21
AvgVolume: 1908
DivYield: 0.89
DivAmount: 0.164
DivRate: 0.656
PayDate: 20190724
ExDivDate: 20190701
CurrentEps: 3.5
SIC: 3825
Precision: 4
Display: 14
GrowthPercent: -0.14
FiscalYearEnd: 20181001
Volatility: 16.5
ListedMarket: 7
OptionRoots: 'A'
InstitutionalPercent: 86.905
YearEndClose: 67.46
Beta: 1.35
Assets: 3848
Liabilities: 1171
BalanceSheetDate: 20190430
LongTermDebt: 1799
CommonSharesOutstanding: 315993
MarketCap: 23184
x52WeekHigh: 82.27
x52WeekHighDate: 20190321
x52WeekLow: 61.01
x52WeekLowDate: 20181024
CalHigh: 82.27
CalHighDate: 20190321
CalLow: 62
CalLowDate: 20190103
LastSplit: []
LastSplitDate: []
PrevSplit: []
PrevSplitDate: []
NAICS: 334516
ShortInterest: 4130628

You can control the query using the DataType (default: 'snapshot'), SecType (default: 'equity') and/or Exchange (default: 'NYSE') parameters:

>> data = IQML('summary', 'SecType','bond', 'Exchange','NYSE', ...
'DataType','fundamental');

>> struct2table(data)
ans =
6326×11 table

Symbol Description Precision Display ListedMarket MaturityDate CouponRate ...
___________ __________________________________________ _________ _______ ____________ ____________ __________
'A20.CB' 'AGILENT TECHNOLOGIES INC. 5.0% SR NTS' [] 12 7 20200715 [] ...
'A23.CB' 'AGILENT TECHNOLOGIES INC. 3.875% 07/15/2' [] 12 7 20230715 3.875
'A26.CB' 'AGILENT TECHNOLOGIES INC 3.05 09/22/2026' [] 12 7 20260922 3.050
'AA.28.CB' 'ALUMINUM CO OF AMERICA 6.75% NTS 1/15/28' [] 12 7 20280115 []
'AA20.CB' 'ALCOA INC. 6.15% SR NTS' [] 12 7 20200815 []
'AA21.CB' 'ALCOA INC. 5.4% SR NTS' [] 12 7 20210415 []
'AA22.CB' 'ALCOA INC NT 5.87%' [] 12 7 20220223 []
'AA24.CB' 'ALCOA INC 5.125% 10/01/2024' [] 12 7 20241001 []
'AA27.CB' 'ALCOA INC 5.9% NTS 2/1/27' [] 12 7 20270201 5.900
'AA37.CB' 'ALCOA INC 5.95% NTS 2/1/37' [] 12 7 20370201 5.950
'AAP20.CB' 'ADVANCE AUTO PARTS INC. 5.75%' [] 12 7 20200501 []
'AAP22.CB' 'ADVANCE AUTO PARTS INC 4.5%' [] 12 7 20220115 []
'AAP23.CB' 'ADVANCE AUTO PARTS 4.5 12/01/23' 2 12 7 20231201 []
'AAPL22.CB' 'APPLE INC 1.00% NOTES 22' [] 0 7 20221110 []
...

Note that there is no Symbol parameter in a 'summary' query data for all the symbols that match the specified SecType and Exchange is returned. For historic market summaries, add the Date parameter (see §5.6).

By default, only data fields that contain information are returned. For example, in the snapshot query for equities, only 28 of 35 data fields are reported; 7 fields are removed from the returned struct array since they contain an empty ([]) value for all securities: MutualDiv, SevenDayYield, OpenInterest, Settlement, SettlementDate, ExpirationDate, Strike.55 Similarly, 3 additional fields (High, Low and VWAP) are not reported for bonds (only 25 fields contain information). To include all these fields (with their empty data values) in the reported data, set the ReportEmptyFields parameter to true (or 1):

>> data = IQML('summary', 'ReportEmptyFields',true)
data =
4749×1 struct array with fields:
Symbol
Exchange
...
(total of 35 data fields)

>> data(1)
ans =
struct with fields:
Symbol: 'A'
...
NeutralTrades: 806
VWAP: 73.1309
MutualDiv: []
SevenDayYield: []
OpenInterest: []
Settlement: []
SettlementDate: []
ExpirationDate: []
Strike: []

Likewise, with a 'fundamental' query, only 41 of 47 possible fields are reported for equities (EstEps, MaturityDate, CouponRate, LEAPs, WRAPs and Expiration fields are not reported);56 for bonds only 11 fields are reported (Symbol, Description, Precision, Display, ListedMarket, MaturityDate, CouponRate, x52WeekHigh, x52WeekHighDate, x52WeekLow and x52WeekLowDate), while 36 other fields are not. As before, to include these fields (with their empty data values) in the reported data, set ReportEmptyFields to true (or 1).

warningMarket summary queries can take a long time to download data, depending on amount of data and your computer speed. To ensure the query does not time-out before completing the download, the default Timeout value for summary queries is set to 300 secs, unlike other queries (5 secs). In some cases, you may need to specify an even larger Timeout.

To reduce processing time, numeric codes (e.g., Exchange, TradedMarket and NAICS) are not interpreted into textual form, unlike the corresponding real-time snapshot (§4.1) and fundamental (§4.2) queries. Use a lookup query (§8) to fetch a description of such codes.

The returned data can be filtered based on multiple criteria, effectively serving as a market scanner (for the latest data by default, or for any other historic date). This is done by setting the Filter parameter to the relevant criteria. For example, to return all NYSE equities whose latest market capitalization is larger than $5Bn, we set a condition on the MarketCap data field (which reports values in $Mn, so $5Bn=5000):

data = IQML('summary', 'SecType','Equity', 'DataType','fundamental', ...
'Exchange','NYSE', 'Filter','MarketCap>5000');

This query only returns 1398 equities, compared to the unfiltered 4749. Multiple filter criteria can be specified using a cell-array. For example (this returns just 100 equities):

data = IQML('summary', 'SecType','Equity', 'DataType','fundamental', ...
'Exchange','NYSE', 'Filter',{'MarketCap>5000','PeRatio<9'});

Multiple filter criteria are AND’ed, meaning that all of the criteria conditions must be met for a security to be reported. If you want to use an OR condition (for example, Market-cap>$5B or P/E<9), combine the conditions within a single filter criterion:

data = IQML('summary', 'SecType','Equity', 'DataType','fundamental', ...
'Exchange','NYSE', 'Filter','MarketCap>5000 | PeRatio<9');

In general, any Matlab expression (arithmetic, function etc.) that involves the reported data field(s) and results in a scalar logical value, is acceptable as Filter critera.

Criteria conditions are case-sensitive and must use exactly the same field names as the reported data fields, otherwise the criteria will be ignored. For example:

data = IQML('summary', 'SecType','Equity', 'DataType','fundamental', ...
'Exchange','NYSE', 'Filter','marketcap>5000');

Warning: ignoring bad summary filter 'marketcap>5000': Unrecognized function or variable 'marketcap'
(Type "warning off IQML:summary:filter" to suppress this warning.)

Whenever any field is included in a filter condition, securities that do not have data for that field (have an empty [] value) will automatically be filtered out of the returned data – they are considered to have failed the entire condition, even if it was only a part of an or condition. For example, if your filter condition is MarketCap>5000, then securities that have MarketCap=[] (i.e. unknown) will not be reported.

Note that the filtering/scanning is not applied at the data source (IQFeed) but rather in IQML, after the full set of data has been downloaded from IQFeed. Therefore, filtered queries will always take longer to process than regular (unfiltered) summary queries.

Note: Market summaries are only available with IQFeed client 6.1 or newer, and only if you are subscribed to the requested data at DTN and there is a relevant data for download (summary data is only available for some combinations of SecType and Exchange). In all other cases, you may receive an error such as one of the following:

The 'summary' query is only supported by IQFeed client 6.1 or newer; you are using version 6.0.

IQML market summary query error: Code: 50004 - User not authorized for market summary file requested.

IQML market summary query error: Code: 50007 - No file available.

A related mechanism for fetching pre-filtered market scans for a select number of Exchanges and Filters is available by setting DataType='Top'. This scanner type does not depend on DTN subscription or IQFeed 6.1, and is much faster than snapshot queries. However, it is limited to just 13 predefined filters and 3 US exchanges (AMEX, NYSE, NASDAQ), only supports equities, does not provide historic data, and only returns only up to top 50 matching equity symbols57 with a few relevant data fields (far fewer fields than the snapshot queries), updated every 5 minutes during the trading day:

>> data = IQML('summary', 'DataType','top', 'Exchange','NYSE', 'Filter','active')
data =
50×1 struct array with fields:
...

>> data(1)
ans =
struct with fields:
Last_Update_Time: '2019/07/12 16:25 EST'
Exchange: 'NYSE'
Symbol: 'ABEV'
Company_Name: 'AMBEV S.A.'
Last_Price: 4.84
Previous_Price: 4.95
Price_Change_Dollars: -0.11
Price_Change_Percent: -2.222
Last_Volume: 50633779
Previous_Volume: 27402071
Volume_Change_Percent: 84.78

Several Filter types return additional data fields, depending on the filter. For example:

>> data = IQML('summary', 'DataType','top', 'Filter','volume spike');
>> data(1)
ans =
struct with fields:
Last_Update_Time: '2019/07/16 16:25 EST'
Exchange: 'NYSE'
Symbol: 'CPE'
Company_Name: 'CALLON PETROLEUM'
Last_Price: 5.73
Previous_Price: 5.38
Price_Change_Dollars: 0.35
Price_Change_Percent: 6.506
Last_Volume: 55574971
Previous_Volume: 57244474
Volume_Change_Percent: -2.92
Average_Volume: 8296000
Volume_vs_Avg_Change_Percent: 569.9

Here’s another example top NASDAQ equities with last price lower than their VWAP:

>> data = IQML('summary', 'DataType','top', 'Exchange','NASDAQ', ...
'Filter','vwap % down');
>> data(1)
ans =
struct with fields:
Last_Update_Time: '2019/07/16 16:25 EST'
Exchange: 'NASDAQ'
Symbol: 'IMRN'
Company_Name: 'IMMURON LTD ADR'
Last_Price: 4.3
Previous_Price: 2.93
Price_Change_Dollars: 1.37
Price_Change_Percent: 46.758
Last_Volume: 11022919
Previous_Volume: 4704
Volume_Change_Percent: 234230.76
VWAP: 5.427
Last_Minus_VWAP_Chng_Pct: -20.77

Note that the 'Top' query may return empty ([]) data for some combinations of Exchange and Filter on certain dates, depending on the market data and availability of the requested scanner on IQFeed’s servers.58 Also note that the reported data may by up to 5 minutes old during the trading day (depending on the query time).

The following table summarizes the differences between market summary query types:

Snapshot

Fundamental

Top

DataType

'snapshot'

'fundamental'

'top'

Exchange

Multiple

Only AMEX, NYSE, NASDAQ

SecType

Multiple

Only 'equity'

Date

Latest (intra-day) or
historic (end of day)

Only latest (updated every 5 minutes during the trading day)

Filter type

Any Matlab function of any combination of data fields

Only one of 13 predefined types

Filter combinations

Multiple criteria supported

Not supported

Processing time

Tens/hundreds of secs

<1 sec

IQFeed client

Requires client 6.1 or newer

Any (client 5.0 or newer)

IQFeed connection

Requires an active IQFeed connection (IQConnect login)

Does not require an active IQFeed connection

Result data fields

Up to 35 fields

Up to 47 fields

Only 11-13 data fields

Result records

All securities that fit the parameters (many thousands)

Only the top 50 securities

The following parameters affect market summary data queries:

Parameter

Data type

Default

Description

DataType

string

'snapshot'

Either 'snapshot', 'fundamental' or 'top'

Exchange

string

'NYSE'

One of the markets listed in §8.3

SecType

string

'Equity'

One of the security types listed in §8.4. SecType is ignored when DataType='top'

Date

integer or string or datetime object

now

(latest available data)

Date for which to fetch the end-of-day data. Examples:

737089 (Matlab datenum format)

datetime('Jan 29, 2018')

20180129 (yyyymmdd format)

'20180129'

'2018/01/29'

'2018-01-29'

Date is ignored when DataType='top'

ReportEmptyFields

logical

false or 0

If true, then irrelevant data fields (which contain empty [] values for all securities) are reported; if false (default), they are not

Filter

string

'active'

When DataType='top', one of:

'active' – most active (highest volume)

'gainer' highest positive price $ change

'loser' – lowest negative price $ change

'% gainer' highest pos. price % change

'% loser' – lowest neg. price % change

'52 week high' – daily high > 52-week

'52 week low' – daily low < 52-week

'volume up' – compared to previous

'volume spike' – compared to average

'VWAP up' – last price > VWAP

'VWAP down' – last price < VWAP

'VWAP % up' – % above VWAP

'VWAP % down' – % below VWAP

string or cell-array of strings

{}

When DataType='snapshot','fundamental':

Zero or more filter criteria (condition strings) – Matlab expression(s) involving the reported data fields, which result in a logical (true/false) value. Examples:

'MaturityDate > 20241231'

'MarketCap > 5000 & PeRatio < 9'

{'MarketCap > 5000', 'Beta >= 1.2'}

Timeout

number

300

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

warningNote: market summary functionality is only available in the Professional IQML license


18 The textual Description fields depend on the MsgParsingLevel parameter having a value of 2 or higher (see §3.2 and §8)

19 Some older versions of IQML returned a different form struct (the same as that reported by streaming quotes - §6.1). This was corrected to match the documentation starting in IQML version 2.00.

20 The additional textual fields Message_Description, Trade_Conditions_Description and Most_Recent_Market_Name are IQML-generated textual interpretations of the codes in the IQFeed-generated Message_Contents, Trade_Conditions and Most_Recent_Trade_Market_Center fields, respectively, as governed by the MsgParsingLevel parameter (see §3.2).

21 Additional description fields will be generated by IQML for those fields that report value codes (for example, the Fraction Display Code and Financial Status Indicator fields), as governed by the MsgParsingLevel parameter (see §3.2).

22 AvailableFields is reported by an IQML('quotes','fields',{}) command – see the previous page in this User Guide.

23 In IQML, the Symbol and Symbols parameters are synonymous – you can use either of them, in any capitalization

24 In this table, “exchange/other” means either the exchange, or some other 3rd-party that provides data to DTN/IQFeed.

25 http://forums.iqfeed.net/index.cfm?page=topic&topicID=3891

26 http://forums.iqfeed.net/index.cfm?page=topic&topicID=3891

27 http://forums.iqfeed.net/index.cfm?page=topic&topicID=5582. Note that this could lead to numeric inaccuracies, for example GOOGL’s split on 4/3/2014 is reported as 0.50 rather than the more accurate 1:1.998 = 0.5005. Also note that some splits (e.g. GOOG’s 1:2.002 split on 3/27/2014) are not reported by IQFeed for some reason (probably a data error).

28 For additional (and more accurate) splits history, refer to https://www.stocksplithistory.com

29 In IQML, the Symbol and Symbols parameters are synonymous – you can use either of them, in any capitalization

30 In this table, “exchange/other” means either the exchange, or some other 3rd-party that provides data to DTN/IQFeed.

31 https://www.census.gov/eos/www/naics

32 https://openfigi.com, https://omg.org/figi

33 Unlike all other fields, this field is not reported by IQFeed but rather computed by IQML, based on the reported fields (Symbol and Expiration Date). It contains a non-empty value only for continuous future contracts (e.g. @ES#).

34 Note that IQFeed’s limitations on live 'secs' interval bars are stricter than the limitations on historical interval bars (§5.4): http://forums.dtn.com/index.cfm?page=topic&topicID=5529

35 The UseParallel parameter is set here in order to avoid the run-time error of “Symbol ‘XXX’ was not found”

36 In IQML, the Symbol and Symbols parameters are synonymous – you can use either of them, in any capitalization

37 IQFeed does not offer deep market depth for equities, nor market width for futures. For such detailed information you could use premium services such as Nasdaq TotalView (http://nasdaqtrader.com/Trader.aspx?id=Totalview2).

38 some fields at the table’s right side are not shown here due to space limitations, but are available in the actual Matlab object

39 Notice that the reported BidTime is a valid time whereas AskTime is not (rather than the opposite, as would be expected since only Ask is valid). This is apparently a bug in IQFeed’s data: http://forums.iqfeed.net/index.cfm?page=topic&topicID=5594

40 IQFeed actually does report empty market-maker quotes, that have neither Bid nor Ask. Such IQFeed messages can be seen if you set the Debug parameter to true or 1 (see §12.1). However, IQML does not report such empty quotes by default, nor count them as valid “events” that should be checked against the requested NumOfEvents parameter value (default value: 10).

41 Old versions of IQML used to automatically try to establish a conection with IQFeed’s L2 server during IQML startup, causing the error message to display for users without an IQFeed Level 2 subscription. This was confusing, since the L2 connection attempt during IQML’s startup was automatic, not cause by a user marketdepth request. In IQML version 2.17 (released on 2019-05-05) the mechanism was changed: IQML now connects to L2 server only as needed (first IQML marketdepth request).

42 In IQML, the Symbol and Symbols parameters are synonymous – you can use either of them, in any capitalization

43 The default value of NumOfEvents was changed from inf to 10 in IQML version 2.17 (released on 2019-05-05)

44 Support for American options is planned in a future release of IQML; there are no current plans to support Asian/exotic options.

45 Matlab’s Financial Toolbox, NAG and Maple report annualized values; for annual values in IQML, set the AnnualFactor to 1.

46 For example, the reported Color value is negative in NAG compared to IQML and Maple.

47 This does not imply that there are no calculation bugs in IQML’s implementation; the Greeks calculation is not trivial.

48 Excluding a few quirks, such as a negative Color value reported by NAG, or Maple’s Lambda calculation, or the AnnualFactor of 1 used by both NAG & Maple. Also compare the very similar values reported by the online calculator http://option-price.com

49 John Hull, Options, Futures, and Other Derivatives (ISBN 9780134472089); https://en.wikipedia.org/wiki/Greeks_(finance)

50 Some short-listed future contracts do not have an immediately inferable UnderlyingSymbol. For example, @CF20C4000 (Corn Jan 2020 Call 4000)’s underlying is not @CF20 (which does not exist). In such cases, IQML tries to use a corresponding contract symbol for the next or the following months (in this case, @CH20 - Corn March 2020).

51 You can query the current LIBOR rate with IQML, for example using symbol ONLIB.X (overnight rate), 1MLIB.X (1 month), 3MLIB.X (3 months), or 1YLIB.X (1 year). Additional durations are also available (http://iqfeed.net/symbolguide/index.cfm?pick=indexRATES&guide=mktindices), but a 1-month rate is often used even for shorter or longer option durations, for consistency. Also see http://forums.iqfeed.net/index.cfm?page=topic&topicID=4387.

52 You can query the current T-bill rate with IQML, for example using symbol TB30.X (30-day rate), IRX.XO (91 days), TB180.X (180 days), or 1YCMY.X (1 year). Also see http://forums.iqfeed.net/index.cfm?page=topic&topicID=4387.

53 In IQML, the Symbol and Symbols parameters are synonymous – you can use either of them, in any capitalization

54 This query was run on July 11, 2019 at 11am EDT

55 Additional fields (for example, Open, High, Low) are missing when the query is run early in the day, before start of trading.

56 The EstEps field was reported by IQFeed in some runs but not others; the reason for this is unclear.

57 The reported equities must not only match the predefined Filter condition, but also have a close price > $2 and volume > 0.

58 As of August 2019, IQFeed has a server problem causing AMEX data to return no results. DTN is working on a fix for this.