Documentation

This is machine translation

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

timeseries

Intraday tick data for Bloomberg connection V3

Syntax

  • d = timeseries(c,s,date)
    example
  • d = timeseries(c,s,date,interval,field)
    example
  • d = timeseries(c,s,date,[],field,options,values)
    example
  • d = timeseries(c,s,{startdate,enddate})
    example
  • d = timeseries(c,s,{startdate,enddate},interval,field)
    example
  • d = timeseries(c,s,{startdate,enddate},[],field)
    example
  • d = timeseries(c,s,{startdate,enddate},[],field,options,values)
    example

Description

example

d = timeseries(c,s,date) retrieves raw tick data d for the security s and connection object c for a specific date date.

example

d = timeseries(c,s,date,interval,field) retrieves raw tick data d for the security s and a specific date date aggregated into intervals of interval for field field.

example

d = timeseries(c,s,date,[],field,options,values) retrieves raw tick data d for a specific date date without an aggregation interval for field field with the specified options options and corresponding values values.

example

d = timeseries(c,s,{startdate,enddate}) retrieves raw tick data d for security s where startdate is the starting date and enddate is the ending date of the date range.

example

d = timeseries(c,s,{startdate,enddate},interval,field) retrieves raw tick data d for a specific date range aggregated into intervals of interval for field field.

example

d = timeseries(c,s,{startdate,enddate},[],field) retrieves raw tick data d for a specific date range without an aggregation interval for field field.

example

d = timeseries(c,s,{startdate,enddate},[],field,options,values) retrieves raw tick data d for a specific date range without an aggregation interval for a specific field with specified options options and corresponding values values.

Examples

collapse all

Create the Bloomberg® connection.

c = blp;

Alternatively, you can connect to the Bloomberg Server API using blpsrv or Bloomberg B-PIPE® using bpipe.

Retrieve today's trade tick series for the IBM® security.

d = timeseries(c,'IBM US Equity',floor(now))
d = 

    'TRADE'    [735537.40]    [181.69]    [100.00]
    'TRADE'    [735537.40]    [181.69]    [100.00]
    'TRADE'    [735537.40]    [181.68]    [100.00]
    ...

d contains the tick type in the first column, the numeric representation of the date and time in the second column, the tick value in the third column, and the tick size in the fourth column. Here, the first row shows that 100 IBM shares sold for $181.69 today.

Close the Bloomberg connection.

close(c)

Create the Bloomberg connection.

c = blp;

Alternatively, you can connect to the Bloomberg Server API using blpsrv or Bloomberg B-PIPE using bpipe.

Retrieve today's trade tick series for the Microsoft® security with pricing source ETPX.

d = timeseries(c,'MSFT@ETPX US Equity',floor(now))
d = 

    'TRADE'    [735537.40]    [35.53]    [100.00]
    'TRADE'    [735537.40]    [35.55]    [200.00]
    'TRADE'    [735537.40]    [35.55]    [100.00]
    ...

d contains the tick type in the first column, the numeric representation of the date and time in the second column, the tick value in the third column, and the tick size in the fourth column. Here, the first row shows that 100 Microsoft shares are sold for $35.53 today.

Close the Bloomberg connection.

close(c)

Create the Bloomberg connection.

c = blp;

Alternatively, you can connect to the Bloomberg Server API using blpsrv or Bloomberg B-PIPE using bpipe.

Retrieve today's trade tick series for the IBM security aggregated into 5-minute intervals.

d = timeseries(c,'IBM US Equity',floor(now),5,'Trade')
d =

  Columns 1 through 7

   735537.40        181.69        181.99        180.10        181.84     252322.00        861.00
   735537.40        181.90        181.97        181.57        181.65      78570.00        535.00
   735537.40        181.73        182.18        181.58        182.07     124898.00        817.00
     ...

  Column 8

   45815588.00
   14282076.00
   22710954.00
   ...

The columns in d contain the following:

  • Numeric representation of date and time

  • Open price

  • High price

  • Low price

  • Closing price

  • Volume of ticks

  • Number of ticks

  • Total tick value in the bar

Here, the first row of data shows that on today's date the open price is $181.69, the high price is $181.99, the low price is $180.10, the closing price is $181.84, the volume is 252,322, the number of ticks is 861, and the total tick value in the bar is $45,815,588. The next row shows tick data for 5 minutes later.

Close the Bloomberg connection.

close(c)

Create the Bloomberg connection.

c = blp;

Alternatively, you can connect to the Bloomberg Server API using blpsrv or Bloomberg B-PIPE using bpipe.

Retrieve today's trade tick series for the 'F US Equity' security without specifying the aggregation parameter. Additionally, return the condition codes.

d = timeseries(c,'F US Equity',floor(now),[],'Trade',...
               'includeConditionCodes','true')
d =

    'TRADE'    [735556.57]    [17.12]    [   100.00]    'R6,IS'  
    'TRADE'    [735556.57]    [17.12]    [   100.00]    ''       
    'TRADE'    [735556.57]    [17.12]    [   500.00]    ''       
    ...

The columns in d contain the following:

  • Tick type

  • Numeric representation of the date and time

  • Tick value

  • Tick size

  • Condition codes

Here, the first row shows that 100 'F US Equity' security shares sold for $17.12 today.

Close the Bloomberg connection.

close(c)

Create the Bloomberg connection.

c = blp;

Alternatively, you can connect to the Bloomberg Server API using blpsrv or Bloomberg B-PIPE using bpipe.

Retrieve the tick series for the 'F US Equity' security for the last business day from the beginning of the day to noon.

d = timeseries(c,'F US Equity',{floor(now-4),floor(now-3.5)})
d =

    'TRADE'    [735552.67]    [17.09]    [   200.00]
    'TRADE'    [735552.67]    [17.09]    [   100.00]
    'TRADE'    [735552.67]    [17.09]    [   100.00]
   ...

d contains the tick type in the first column, the numeric representation of the date and time in the second column, the tick value in the third column, and the tick size in the fourth column. Here, the first row shows that 200 'F US Equity' security shares were sold for $17.09 on the last business day.

Close the Bloomberg connection.

close(c)

Create the Bloomberg connection.

c = blp;

Alternatively, you can connect to the Bloomberg Server API using blpsrv or Bloomberg B-PIPE using bpipe.

Retrieve the trade tick series for the past 50 days for the IBM security aggregated into 5-minute intervals.

d = timeseries(c,'IBM US Equity',{floor(now)-50,floor(now)},5,'Trade')
ans =

  Columns 1 through 7

   735487.40        187.20        187.60        187.02        187.08     207683.00        560.00
   735487.40        187.03        187.13        186.65        186.78      46990.00        349.00
   735487.40        186.78        186.78        186.40        186.47      51589.00        399.00
     ...

Column 8

   38902968.00
    8779374.00
    9626896.00
   ...

The columns in d contain the following:

  • Numeric representation of date and time

  • Open price

  • High price

  • Low price

  • Closing price

  • Volume of ticks

  • Number of ticks

  • Total tick value in the bar

The first row of data shows that on today's date the open price is $187.20, the high price is $187.60, the low price is $187.02, the closing price is $187.08, the volume of ticks is 207,683, the number of ticks is 560, and the total tick value in the bar is $38,902,968. The next row shows tick data for 5 minutes later.

Close the Bloomberg connection.

close(c)

Create the Bloomberg connection.

c = blp;

Alternatively, you can connect to the Bloomberg Server API using blpsrv or Bloomberg B-PIPE using bpipe.

Return the Bid, Ask, and trade tick series for the security 'F US Equity' for yesterday with a time interval at noon, without specifying the aggregation parameter.

d = timeseries(c,'F US Equity',{floor(now-1)+.5,floor(now-1)+.51},...
               [],{'Bid','Ask','Trade'})
d = 

    'TRADE'    [735550.50]    [16.71]    [100.00]
    'ASK'      [735550.50]    [16.71]    [312.00]
    'BID'      [735550.50]    [16.70]    [177.00]
    ...

d contains the tick type in the first column, the numeric representation of the date and time in the second column, the tick value in the third column, and the tick size in the fourth column. Here, the first row shows that 100 'F US Equity' security shares sold for $16.71 yesterday.

Close the Bloomberg connection.

close(c)

Create the Bloomberg connection.

c = blp;

Alternatively, you can connect to the Bloomberg Server API using blpsrv or Bloomberg B-PIPE using bpipe.

Return the trade tick series for the security 'F US Equity' for yesterday with a time interval at noon, without specifying the aggregation parameter. Additionally, return the condition codes, exchange codes, and broker codes.

d = timeseries(c,'F US Equity',{floor(now-1)+.5,floor(now-1)+.51},...
               [],'Trade',{'includeConditionCodes',...
               'includeExchangeCodes','includeBrokerCodes'},...
               {'true','true','true'})
d = 

    'TRADE'    [735550.50]    [16.71]    [100.00]    'T'     'D'
    'TRADE'    [735550.50]    [16.70]    [400.00]    'IS'    'B'
    'TRADE'    [735550.50]    [16.70]    [100.00]    'IS'    'B'
    ...

The columns in d contain the following:

  • Tick type

  • Numeric representation of the date and time

  • Tick value

  • Tick size

  • Exchange condition codes

  • Exchange codes

Broker codes are available for Canadian, Finnish, Mexican, Philippine, and Swedish equities only. If the equity is one of the former, then the broker buy code would be in the seventh column and the broker sell code would be in the eighth column.

Here, the first row shows that 100 'F US Equity' security shares sold for $16.71 yesterday.

Close the Bloomberg connection.

close(c)

Related Examples

Input Arguments

collapse all

Bloomberg connection, specified as a connection object created using blp, blpsrv, or bpipe.

Security, specified as a character vector for a single Bloomberg security.

Data Types: char

Date, specified as a numeric scalar or character vector to denote the specific date for the returned tick data.

Example: floor(now)

Data Types: double | char

Time interval, specified as a scalar to denote the number of minutes between ticks for the returned tick data.

Data Types: double

Bloomberg field, specified as one of these values that define the tick data to return.

Request TypeValid Bloomberg Field Values

IntradayBarRequest with time interval specified

'TRADE'
'BID'
'ASK'
'BID_BEST'
'ASK_BEST'

IntradayTickRequest with no time interval specified

'TRADE'
'BID'
'ASK'
'BID_BEST'
'ASK_BEST'
'SETTLE'

Bloomberg API options, specified as one of these values.

ValueDescription

'includeConditionCodes'

Exchange condition codes associated with the event

'includeExchangeCodes'

Exchange code where tick originated

'includeBrokerCodes'

Broker code

'includeRpsCodes'

Reporting party side

'includeNonPlottableEvents'

After-hours data

To specify more than one Bloomberg API option, use a cell array of these values.

Specify the corresponding Bloomberg API value for each API option.

For example, to specify one Bloomberg API option, enter:

d = timeseries(c,'F US Equity',floor(now),[],'Trade',...
               'includeConditionCodes','true');

To specify two Bloomberg API options, enter:

d = timeseries(c,'F US Equity',floor(now),[],'Trade',...
               {'includeConditionCodes','includeExchangeCodes'},...
               {'true','true'});

Data Types: char | cell

Bloomberg API values, specified as 'true' or 'false'. Each value corresponds to the specified Bloomberg API option. To specify more than one Bloomberg API value, use a cell array.

For example, to specify one Bloomberg API option, enter:

d = timeseries(c,'F US Equity',floor(now),[],'Trade',...
               'includeConditionCodes','true');

To specify two Bloomberg API options, enter:

d = timeseries(c,'F US Equity',floor(now),[],'Trade',...
               {'includeConditionCodes','includeExchangeCodes'},...
               {'true','true'});

Data Types: char | cell

Start date, specified as a numeric scalar or character vector to denote the start date of the date range for the returned tick data.

Example: floor(now-1)

Data Types: double | char

End date, specified as a numeric scalar or character vector to denote the end date of the date range for the returned tick data.

Example: floor(now)

Data Types: double | char

Output Arguments

collapse all

Bloomberg tick data, returned as a cell array for requests without a specified time interval or a matrix for requests with a specified time interval.

Limitations

When the data request is too large, timeseries displays this error message:

Timeout error:
Error using blp/timeseries>processResponseEvent (line 338) REQUEST FAILED: responseError = {

source = bbdbl7

code = -2

category = TIMEOUT

message = Timed out getting data from store [nid:327]

subcategory = INTERNAL_ERROR

}

To fix this error, shorten the length of the date range by modifying the input arguments startdate and enddate.

More About

collapse all

Tips

  • For better performance, add the Bloomberg file blpapi3.jar to the MATLAB® static Java® class path by modifying the file $MATLAB/toolbox/local/javaclasspath.txt. For details about the static Java class path, see Static Path.

  • You cannot retrieve Bloomberg intraday tick data for a date more than 140 days ago.

  • The Bloomberg API Developer's Guide states that 'TRADE' corresponds to LAST_PRICE for IntradayTickRequest and IntradayBarRequest.

  • Bloomberg V3 intraday tick data supports additional name-value pairs. For details on these pairs, see the Bloomberg API Developer's Guide by typing WAPI and clicking the <GO> button on the Bloomberg terminal.

  • You can check data and field availability by using the Bloomberg Excel® Add-In.

See Also

| | | |

Introduced in R2010a

Was this topic helpful?