IQFeed Streaming, Static, and Fundamental Data Provider

Modified on 2021/04/26 11:56 by Administrator — Categorized as: Providers

What it is

The IQFeed provider for Wealth-Lab has streaming, static, and limited fundamental data (v2020.09 and up) by DTN IQFeed for U.S. and Canadian stocks, futures, options, forex and more; Click here for a full list of services. The IQFeed provider supports tick, second, and minute bars. For details on installing the IQFeed client and the Wealth-Lab IQFeed provider, see the IQFeed Extensions Detail page. There you'll find a link to sign up for a free trial.

Data Options

IQFeed options in the Data Manager

Smart Update
Outside of market hours and when Smart Update is enabled, the IQFeed Provider will check if the symbol/interval data is already up-to-date before making a historical data request. Market hours are 0930-1600 EST by default but can be changed by adding symbols to other markets in the Market Manager. Use this option to comfortably leave the "Update Data On-Demand" option selected while backtesting outside of market hours. Also, this feature will allow the Strategy Monitor to quickly initialize with data you've already updated before the market open.

Regular Session Only (RSO)
With RSO, the IQFeed Provider requests intraday data from 0930 to 1600 only, and therefore it is not required to use the Market Manager to filter data for the regular session, which affects data loading speed. Apart from delivering data only between 0930 and 1600, this setting has several other effects:
  1. Bars will be referenced to 0930. Examples: the first 20 minute bar will aggregate trades from 0930 to 0950 and then to 1010, etc. Hourly bars will end at 1030, 1130, ..., 1600.
  2. Streaming will only subscribe to regular session trading (no pre/post market stream)
  3. The first intraday bar opening price will be replaced with the Daily bars' opening price - but only if the Daily bar is already cached. This feature was implemented because the IQFeed history time filter does not exclude "Form T" (premarket) trades with timestamps after 0930. Often these trades wind up being the opening price of the first intraday bar, so this feature aligns the opening intraday bar trade with the official daily opening trade.

In summary, for the Opening Price replacement feature to work, the following conditions must exist:
Split Adjust Intraday
Although IQFeed adjusts Daily bars for splits, they do not adjust intraday pricing. With this option selected, the Wealth-Lab IQFeed provider will maintain intraday prices adjusted too. Since IQFeed supplies only the last two splits, the Wealth-Lab provider uses an embedded historical resource of split data in order to adjust all intraday history. For example, as of 8/18/2020, QLD split 4 times since 2012. Without the split resource, intraday data would be adjusted only for the splits in 2020 and 2017, but not for the splits in 2015 and 2012.

Clear IQFeed Data
If you already have downloaded history and have made changes to either of the previous options, you should refresh all IQFeed data by clicking this button and then performing an IQFeed Provider update.

Always Include the current partial bar
This option simply will display all the history, even for the current partial bar for on-demand requests. Although these data are cached, subsequent requests will correct any bars that have changed in the recent history.

60-Minute timestamp
If you do not use the RSO option, hourly (and all others) bars will be referenced to 1200 AM. Therefore, hourly bars will end "on the hour" mark. While that's fine for streaming charts, it is not compatible with the Strategy Monitor, which requires hourly bars to have the 1030, 1130, ... , 1600 timestamp convention. This option will build the hourly bars with the required convention for Strategy Monitor compatibility. If you change this option, click the "Clear 60-Minute Data" button and then update to refresh your 60-Minute DataSets.

Connection Settings
A maximum of 10 threads in parallel are for historical data updates. Generally you don't need to change this setting, but if you have a bad connection, try reducing this number.

Fundamental Items

Although IQFeed isn't really a bonafide Fundamental data provider, it does include some current fundamental and technical data points that could be used in scans. The IQFeed Provider updates the Fundamental message cache any time the message is received for a stock that you request to stream or update from the Data Manager. The full list of items available are identified in the table below and an explanation of how to access the data follows.


Index (6.1)

Field Name

Return Type

Description of field

0

F

string

The character F, indicating a fundamental data message

1

Symbol

string

The Symbol ID to match with watch request

2

Exchange ID

int

This is the Exchange Group ID. Converted from hex to decimal - use the Listed Markets lookup to decode this value.

3

PE

double

Price/Earnings ratio

4

Average Volume

int

Average daily volume in 1000's of shares (4 week average)

5

52 Week High

double

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

6

52 Week Low

double

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

7

Calendar year high

double

High price for the current calendar year.

8

Calendar year low

double

Low price for the current calendar year.

9

Dividend yield

double

The annual dividends per share paid by the company divided by the current market price per share of stock sent as a percentage.

10

Dividend amount

double

The current quarter actual dividend

11

Dividend rate

double

The annualized amount at which a dividend is expected to be paid by a company

12

Pay date

DateTime

Date on which a company made its last dividend payment

13

Ex-dividend date

DateTime

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

14

Current year earnings per share

double

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

15

Next year earnings per share

double

The total amount of earnings per share a company is estimated to accumulate over the next four quarters of the current fiscal year

16

Five-year growth percentage

double

Earnings Per Share growth rate over a five year period.

17

Fiscal year end

int

The two digit month that the fiscal year ends for a company.

18

Company name

string

Company name or contract description

19

Root Option symbol(s)

string

A space separated list; there may be more than one

20

Percent held by institutions

double

A percentage of outstanding shares held by banks and institutions.

21

Beta

double

A coefficient measuring a stock's relative volatility. It is the covariance of a stock in relation to the rest of the stock market. 30 day historical volatility.

22

Leaps

string

Long term equity anticipation securities; A space separated list; there may be more than one

23

Current assets

double

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

24

Current liabilities

double

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

25

Balance sheet date

DateTime

Last date that a company issued their quarterly report.

26

Long-term debt

double

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

27

Common shares outstanding

double

The amount of common shares outstanding in 1000's of shares.

28

Split factor 1

SplitData type

WealthLab.DataProviders.IQFeed.SplitData.Factor (double) and .Ex_Date (DateTime)

29

Split factor 2

SplitData type

WealthLab.DataProviders.IQFeed.SplitData.Factor (double) and .Ex_Date (DateTime)

30

Format Code

string

Display format code, See: Price Format Codes

31

Precision

int

Number of decimal digits

32

SIC

int

Federally designed numbering system identifying companies by industry. This 4 digit number corresponds to a specific industry.

33

Historical Volatility

double

30-trading day volatility that it is calculated using Black-Scholes Wiki Invest model.   NOTE: For futures symbols this field is the Implied Volatility instead of Historical Volatility30-trading day volatility that it is calculated using Black-Scholes Wiki Invest model.   NOTE: For futures symbols this field is the Implied Volatility instead of Historical Volatility

34

Security Type

string

The security type code, See: Security Types

35

Listed Market

string

The listing market ID, See: Listed Markets

36

52 Week High Date

DateTime

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

37

52 Week Low Date

DateTime

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

38

Calendar Year High Date

DateTime

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

39

Calendar Year Low Date

DateTime

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

40

Year End Close

double

Price of Year End Close. (Equities Only)

41

Maturity Date

DateTime

Date of maturity for a Bond.

42

Coupon Rate

double

Interest Rate for a Bond.

43

Expiration Date

DateTime

IEOptions, Futures, FutureOptions, and SSFutures only

44

Strike Price

double

IEOptions only

45

NAICS

int

North American Industry Classification System

46

Exchange Root

string

The root symbol that you can find this symbol listed under at the exchange.

47

Options Premium Multiplier

double

IEOptions only

48

Options Multiple Deliverables

int

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

49

Session Open Time

TimeSpan

Futures and Future Options Only

50

Session Close Time

TimeSpan

Futures and Future Options Only

51

Base Currency

string

Futures and Future Options Only

52

Contract Size

string

Deliverable quantitiy of a future or option contract.

53

Contract Months

string

non-delimited string of upper-case single character month codes

54

Minimum Tick Size

double

Minimum price movement.

55

First Delivery Date

DateTime

Futures and Future Options Only

56

FIGI

string

Financial Instrument Global Identifier

57

Security SubType

int

The security SubType code, See: Security Sub-Types

How to use

Accessing the fundamental fields from a script is simple. Add the using "WealthLab.DataProviders.IQFeed;" statement and then call the appropriate IQFundamental method for the item's data type. For example, since the "Company Name" data type is a string, call IQFundamental.ValueString(Bars.Symbol, "company name"); Since "Ex-dividend date" is a DateTime call IQFundamental.ValueDateTime(Bars.Symbol, "ex-dividend date"). It's not required to SetContext to get fundamental data for other symbols, just pass the symbol string you want data for. The IQFundamental method will always return a value, but if the data do not exist, strings will be empty, numbers will be 0, DateTime will be 1/1/1900, etc.


/* Note that the item is case insensitive.  "Symbol" is the same as "symboL" or "SYMBol" */
using System;
using System.Collections.Generic;
using System.Text;
using WealthLab;
using WealthLab.Indicators;
using WealthLab.DataProviders.IQFeed;

namespace WealthLab.Strategies { public class IQFundamentalDemo : WealthScript { protected override void Execute() { ClearDebug(); string symbol = Bars.Symbol; string cname = IQFundamental.ValueString(symbol, "Company Name"); PrintDebug(String.Format("Company name:\t{0}", cname)); double shrs = IQFundamental.ValueDouble(symbol, "Common shares outstanding"); PrintDebug(String.Format("Common shrs:\t{0}", shrs));

double wh = IQFundamental.ValueDouble(symbol, "52 week high"); PrintDebug(String.Format("52-week high:\t{0}", wh)); int code = IQFundamental.ValueInt(symbol, "NAICS"); PrintDebug(String.Format("NAICS Code:\t{0}", code));

DateTime exdiv = IQFundamental.ValueDateTime(symbol, "Ex-dividend date"); PrintDebug(String.Format("Ex-div date:\t{0:yyyy-MM-dd}", exdiv)); DateTime maturity = IQFundamental.ValueDateTime(symbol, "Maturity Date"); PrintDebug(String.Format("Ex-div date:\t{0:yyyy-MM-dd}", maturity)); SplitData mostrecentSplit = IQFundamental.ValueSplitData(symbol, "Split Factor 1"); PrintDebug(String.Format("Most recent split factor from IQFeed: {0:N8}; Ex-date: {1:yyyy-MM-dd}", mostrecentSplit.Factor, mostrecentSplit.Ex_Date )); SplitData penultimateSplit = IQFundamental.ValueSplitData(symbol, "Split Factor 2"); PrintDebug(String.Format("Penultimate split factor from IQFeed: {0:N8}; Ex-date: {1:yyyy-MM-dd}", penultimateSplit.Factor, penultimateSplit.Ex_Date ));

// The list contains all splits in the resource *plus* those from IQFeed *if* the dates don't already exist in the resource List<SplitData> lst = IQFundamental.SplitDataList(symbol); foreach (SplitData sd in lst) { PrintDebug(string.Format("{0:yyyy-MM-dd}\t{1:N8}", sd.Ex_Date, sd.Factor)); }

} } }

Notes

Possible issues and limitations: