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 string.

daterange

Ether 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 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 and then 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 Time Stamp, Last, Last Size, Total Volume, Bid, Ask, and TickID.

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 Request ID, Time, Stamp, High, Low, Open, Close, Total Volume, and 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 iqfeedlistener and iqfeedeventhandler. Display the results in the MATLAB workspace in the variable IQFeedTimeseriesData.

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

More About

expand all

Tips

  • When you make multiple requests with multiple messages, this error might occur: 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.

Was this topic helpful?