Main Content

timeseries

Intraday tick WDS data

Description

example

d = timeseries(c,s,f,t) returns raw intraday tick Wind Data Feed Services (WDS) data for the specified security, fields, and date using the WDS connection.

example

d = timeseries(c,s,f,{startdate,enddate}) returns raw WDS intraday tick data for the specified date range.

example

d = timeseries(c,s,f,{startdate,enddate},interval) specifies an interval for the intraday data to return.

example

d = timeseries(c,s,f,{startdate,enddate},interval,Name,Value) specifies additional options using one or more name-value pair arguments. These options specify a time range for each day in the specified date range. For example, 'PeriodStart',datetime('10:30:00') sets a time range that starts at 10:30 AM and ends at the end of the trading day.

[d,e] = timeseries(___) also returns the WDS error identifier using any of the input argument combinations in the previous syntaxes. For troubleshooting, contact Wind Information Co., Ltd.

Examples

collapse all

Using a WDS connection, retrieve intraday tick data for a single security and display the data.

Create a WDS connection.

c = wind;

Format output data for currency.

format bank

For the 600000.SH security, retrieve the intraday tick data for high and low prices. Retrieve ticks for the current day using the WDS connection.

s = {'600000.SH'};
f = ["high","low"];
t = datetime('now');
d = timeseries(c,s,f,t);

d is a timetable that contains a row for each tick with the time and a variable for each specified field.

Display the first three rows of intraday tick data.

head(d,3)
ans=3×2 timetable
            Time            high      low 
    ____________________    _____    _____

    28-Nov-2017 13:17:42    13.07    12.92
    28-Nov-2017 13:17:45    13.07    12.92
    28-Nov-2017 13:17:48    13.07    12.92

Close the WDS connection.

close(c)

Using a WDS connection, retrieve intraday tick data for a single security and display the data. Specify a date range for the intraday tick data to return.

Create a WDS connection.

c = wind;

Format output data for currency.

format bank

For the 600000.SH security, retrieve the intraday tick data for high and low prices. Retrieve ticks from November 20, 2017 through November 23, 2017 using the WDS connection.

s = {'600000.SH'};
f = ["high","low"];
startdate = datetime('2017-11-20');
enddate = datetime('2017-11-23');
d = timeseries(c,s,f,{startdate,enddate});

d is a timetable that contains a row for each tick with the time and a variable for each specified field.

Display the last eight rows of intraday tick data.

tail(d)
ans=8×2 timetable
            Time            high      low 
    ____________________    _____    _____

    22-Nov-2017 14:59:46    13.44    13.00
    22-Nov-2017 14:59:49    13.44    13.00
    22-Nov-2017 14:59:52    13.44    13.00
    22-Nov-2017 14:59:55    13.44    13.00
    22-Nov-2017 14:59:58    13.44    13.00
    22-Nov-2017 15:00:01    13.44    13.00
    22-Nov-2017 15:00:02    13.44    13.00
    22-Nov-2017 15:00:02    13.44    13.00

Close the WDS connection.

close(c)

Using a WDS connection, retrieve intraday tick data for a single security and display the data. Specify a date range for the intraday tick data to return. Also, specify the interval to aggregate the tick data.

Create a WDS connection.

c = wind;

Format output data for currency.

format bank

For the 600000.SH security, retrieve the intraday tick data for high and low prices. Retrieve ticks from November 20, 2017 through November 23, 2017 using the WDS connection. Specify 1-minute bars to aggregate the data.

s = {'600000.SH'};
f = ["high","low"];
startdate = datetime('2017-11-20');
enddate = datetime('2017-11-23');
interval = 1;
d = timeseries(c,s,f,{startdate,enddate},interval);

d is a timetable that contains a row for each aggregated tick with the time and a variable for each specified field.

Display the last eight rows of the aggregated intraday tick data.

tail(d)
ans=8×2 timetable
            Time            high      low 
    ____________________    _____    _____

    22-Nov-2017 14:53:00    13.22    13.21
    22-Nov-2017 14:54:00    13.23    13.21
    22-Nov-2017 14:55:00    13.23    13.22
    22-Nov-2017 14:56:00    13.23    13.22
    22-Nov-2017 14:57:00    13.23    13.22
    22-Nov-2017 14:58:00    13.23    13.22
    22-Nov-2017 14:59:00    13.24    13.21
    22-Nov-2017 15:00:00    13.23    13.23

Close the WDS connection.

close(c)

Using a WDS connection, retrieve intraday tick data for a single security and display the data. Specify a date range for the intraday tick data to return. Also, specify the interval to aggregate the tick data. Then, specify the time range for each day in the date range.

Create a WDS connection.

c = wind;

Format output data for currency.

format bank

For the 600000.SH security, retrieve the intraday tick data for high and low prices. Retrieve ticks from November 20, 2017 through November 23, 2017 using the WDS connection. Specify 1-minute bars to aggregate the data. Also, specify the time range from 9:30 AM through 10:30 AM using the 'PeriodStart' and 'PeriodEnd' name-value pair arguments.

s = {'600000.SH'};
f = ["high","low"];
startdate = datetime('2017-11-20');
enddate = datetime('2017-11-23');
interval = 1;
starttime = datetime('09:30:00');
endtime = datetime('10:30:00');
d = timeseries(c,s,f,{startdate,enddate},interval,'PeriodStart',starttime,'PeriodEnd',endtime);

d is a timetable that contains a row for each aggregated tick with the time and a variable for each specified field.

Display the first three rows of the aggregated intraday tick data.

head(d,3)
ans=3×2 timetable
            Time            high      low 
    ____________________    _____    _____

    20-Nov-2017 09:30:00    12.72    12.68
    20-Nov-2017 09:31:00    12.75    12.71
    20-Nov-2017 09:32:00    12.77    12.73

Close the WDS connection.

close(c)

Input Arguments

collapse all

WDS connection, specified as a connection object created with the wind function.

Security, specified as a character vector or string scalar.

Example: '0001.HK'

Data Types: char | string

Fields, specified as a character vector, string scalar, cell array of character vectors, or string array. For a single field, use a character vector or string scalar. For multiple fields, use a cell array of character vectors or string array.

For details about valid fields, contact Wind Information Co., Ltd.

Example: {"high","low"}

Data Types: char | string | cell

Date, specified as a datetime scalar, numeric scalar, character vector, or string scalar.

Example: datetime('today')

Data Types: datetime | double | char | string

Start date, specified as a datetime scalar, numeric scalar, character vector, or string scalar.

Example: datetime('2017-08-10')

Data Types: datetime | double | char | string

End date, specified as a datetime scalar, numeric scalar, character vector, or string scalar.

Example: datetime('2017-08-19')

Data Types: datetime | double | char | string

Interval for aggregating interval tick data into minute bars, specified as a numeric scalar.

Example: 1

Data Types: double

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: d = timeseries(c,'0001.HK','open',{'2017-08-10','2017-08-19'},1,'PeriodStart',datetime('now')-.25,'PeriodEnd',datetime('now')) returns aggregated ticks for the open price in 1-minute bars for the 0001.HK security from August 10, 2017, through August 19, 2017. This syntax returns data for ticks that occur within 6 hours of the current time in each day.

Start time, specified as the comma-separated pair consisting of 'PeriodStart' and a datetime scalar, numeric scalar, character vector, or string scalar.

Use the 'PeriodStart' name-value pair argument with the PeriodEnd name-value pair argument to specify the time range for each day in the date range from startdate through enddate.

If you do not specify the 'PeriodEnd' name-value pair argument, the timeseries function uses the end of the trading day as the end of the time range.

Example: datetime('now')-.5

Data Types: datetime | double | char | string

End time, specified as the comma-separated pair consisting of 'PeriodEnd' and a datetime scalar, numeric scalar, character vector, or string scalar.

Use the 'PeriodEnd' name-value pair argument with the PeriodStart name-value pair argument to specify the time range for each day in the date range from startdate through enddate.

If you do not specify the 'PeriodStart' name-value pair argument, the timeseries function uses the start of the trading day as the start of the time range.

Example: datetime('now')

Data Types: datetime | double | char | string

Output Arguments

collapse all

Intraday tick WDS data, returned as a timetable. The rows of the timetable correspond to the date range specified by startdate and enddate and, optionally, the time range specified by the PeriodStart and PeriodEnd name-value pair arguments. The variables of the timetable correspond to the fields specified in the f input argument.

WDS error identifier, returned as a numeric scalar. The value 0 indicates a successful execution of the timeseries function. Otherwise, for details about the error, contact Wind Information Co., Ltd.

Version History

Introduced in R2018a