Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

timeseries

IQFEED asynchronous historical end-of-period data

Syntax

timeseries(Q, S, daterange)
timeseries(Q, S, daterange, per, elistener, ecallback)

Description

timeseries(Q, S, daterange) returns intraday ticks for the given date range using the default socket listener and event handler.

timeseries(Q, S, daterange, per, elistener, ecallback) returns intraday ticks for the given date range and defined period using an explicitly defined socket listener and event handler.

Data requests are returned asynchronously. For requests that return a large number of ticks, there may be a significant lag between the request and when the data is returned to the MATLAB® workspace.

Arguments

Q

IQFEED® connection handle created using iqf.

S

S is a single security input specified as a character vector or string.

daterange

Either a scalar value that specifies how many periods of data to return or a date range of the form{startdate,enddate}. startdate and enddate can be input as MATLAB date numbers, character vectors, or strings.

per

Specifies, in seconds, the bar interval of the ticks used to aggregate ticks into intraday bars.

elistener

Function handle that specifies the function used to listen for data on the IQFEED Lookup port.

ecallback

Function handle that specifies the function that processes data event.

Examples

Return intraday ticks for a given date range and use the default socket listener and event handler. Display the results in the MATLAB workspace in the variable IQFeedTimeseriesData.

timeseries(q,'ABC',{floor(now),now})
openvar('IQFeedTimeseriesData')

For data that is not aggregated, the fields returned are:

  • Timestamp

  • Last

  • Last size

  • Total volume

  • Bid

  • Ask

  • TickID

  • IQFEED reserved field

  • IQFEED reserved field

  • Basis for last

Basis for last is either a C that means the last qualified trade or E that means an extended trade.

Return the intraday ticks for a date range using the 24-hour military format, per of 60 seconds, and the default socket listener and event handler. Display the results in the MATLAB workspace in the variable IQFeedTimeseriesData.

timeseries(q,'ABC',{'02/12/2012 09:30:00','02/12/2012 16:00:00'},60)
openvar('IQFeedTimeseriesData')

For aggregated data, the fields returned are:

  • Timestamp

  • High

  • Low

  • Open

  • Close

  • Total volume

  • Period volume

Return the intraday ticks for a date range using the 12-hour time format.

timeseries(q,'ABC',{'02/12/2012 09:30:00 AM','02/12/2012 04:00:00 PM'},60)
openvar('IQFeedTimeseriesData')

Return the intraday ticks for a date range on the security ABC using the function handles iqtimeseriesfeedlistener and iqtimeseriesfeedeventhandler. Display the results in the MATLAB workspace in the variable IQFeedTimeseriesData.

timeseries(q,'ABC',{floor(now),now},[],@iqtimeseriesfeedlistener,@iqtimeseriesfeedeventhandler)
openvar('IQFeedTimeseriesData')

Tips

  • When you make multiple requests with multiple messages, this error might display: Warning: Error occurred while executing delegate callback: Message: The IAsyncResult object was not returned from the corresponding asynchronous method on this class.

    To fix this, restart MATLAB.

Introduced in R2012b

Was this topic helpful?