timeseries

RavenPack News Analytics intraday and historical data

Description

example

d = timeseries(c,symbol,{startdate,enddate}) retrieves RavenPack® News Analytics intraday or historical data. This function uses the RavenPack News Analytics connection c, RavenPack entitled symbol, and a date range between the start date startdate and end date enddate.

example

d = timeseries(c,symbol,{startdate,enddate},fields) retrieves RavenPack News Analytics intraday or historical data for specific RavenPack fields.

Examples

collapse all

Create a RavenPack News Analytics connection c using the user name username and password pwd.

c = ravenpack('username','pwd');

Retrieve RavenPack News Analytics data for the last 15 minutes. Here, the symbol is set to the entitled symbol (entity-scores :rpna-4.0-eqt). The start date is set to 15 minutes ago. The end date is the current date and time.

symbol = '(entity-scores :rpna-4.0-eqt)';
startdate = now-.01;
enddate = now;

d = timeseries(c,symbol,{startdate,enddate});

d is a table that contains the RavenPack News Analytics data.

Display the first four variables of the first record of intraday data.

d(1,1:4)
ans =

  1×4 table

       TIMESTAMP_UTC        RP_ENTITY_ID    ENTITY_TYPE    ENTITY_NAME 
    ____________________    ____________    ___________    ____________

    14-May-2018 15:07:16       2491BC          COMP        Twitter Inc.

Each row in the table is one record of news data. Here, the first four variables specify a news event on May 14, 2018 about a company.

List the variables in the data.

d.Properties.VariableNames
ans =

  1×46 cell array

  Columns 1 through 5

    {'TIMESTAMP_UTC'}    {'RP_ENTITY_ID'}    {'ENTITY_TYPE'}    {'ENTITY_NAME'}    {'POSITION_NAME'}

  Columns 6 through 11

    {'RP_POSITION_ID'}    {'COUNTRY_CODE'}    {'RELEVANCE'}    {'TOPIC'}    {'GROUP'}    {'TYPE'}

  Columns 12 through 17

    {'SUB_TYPE'}    {'PROPERTY'}    {'EVALUATION_METHOD'}    {'MATURITY'}    {'CATEGORY'}    {'ESS'}

  Columns 18 through 23

    {'AES'}    {'AEV'}    {'ENS'}    {'ENS_SIMILARITY_…'}    {'ENS_KEY'}    {'ENS_ELAPSED'}

  Columns 24 through 28

    {'G_ENS'}    {'G_ENS_SIMILARIT…'}    {'G_ENS_KEY'}    {'G_ENS_ELAPSED'}    {'EVENT_SIMILARIT…'}

  Columns 29 through 33

    {'NEWS_TYPE'}    {'SOURCE'}    {'RP_STORY_ID'}    {'RP_STORY_EVENT_…'}    {'RP_STORY_EVENT_…'}

  Columns 34 through 41

    {'PRODUCT_KEY'}    {'COMPANY'}    {'ISIN'}    {'CSS'}    {'NIP'}    {'PEQ'}    {'BEE'}    {'BMQ'}

  Columns 42 through 46

    {'BAM'}    {'BCA'}    {'BER'}    {'ANL_CHG'}    {'MCQ'}

For details about each variable in the table, see RavenPack News Analytics User Guide and Service Overview in the RavenPack Developer Zone Overview.

Close the RavenPack News Analytics connection.

close(c)

Create a RavenPack News Analytics connection c using the user name username and password pwd.

c = ravenpack('username','pwd');

Retrieve RavenPack News Analytics data for the last minute using RavenPack fields. Here, the symbol is set to the entitled symbol (entity-scores :rpna-4.0-eqt). The start date is set to a minute ago. The end date is the current date and time. The fields list contains these fields:

  • ENTITY_NAME

  • CATEGORY

  • SUB_TYPE

symbol = '(entity-scores :rpna-4.0-eqt)';
startdate = now-.001;
enddate = now;
fields = {'ENTITY_NAME','CATEGORY','SUB_TYPE'};

d = timeseries(c,symbol,{startdate,enddate},fields);

d is a table that contains RavenPack News Analytics data for the companies with news events. Each row in the table is a news event for a company.

Display the data for the first few news events.

head(d)
ans =

  8×4 table

       TIMESTAMP_UTC                 ENTITY_NAME              CATEGORY       SUB_TYPE  
    ____________________    _____________________________    ___________    ___________

    14-May-2018 15:24:43    Canterbury Park Holding Corp.    earnings       <undefined>
    14-May-2018 15:24:45    Petróleos de Venezuela S.A       <undefined>    <undefined>
    14-May-2018 15:24:45    ConocoPhillips Co.               <undefined>    <undefined>
    14-May-2018 15:24:45    Facebook Inc.                    <undefined>    <undefined>
    14-May-2018 15:24:45    Rockwell Automation Inc.         <undefined>    <undefined>
    14-May-2018 15:24:45    ABB Ltd.                         <undefined>    <undefined>
    14-May-2018 15:24:45    Duravant LLC                     <undefined>    <undefined>
    14-May-2018 15:24:45    Honeywell International Inc.     <undefined>    <undefined>

Close the RavenPack News Analytics connection.

close(c)

Create a RavenPack News Analytics connection c using the user name username and password pwd.

c = ravenpack('username','pwd');

Retrieve RavenPack News Analytics data for the last day. Here, the symbol is set to the entitled symbol (entity-scores :rpna-4.0-eqt). The start date is set to 1 day ago. The end date is the current date and time.

symbol = '(entity-scores :rpna-4.0-eqt)';
startdate = now-1;
enddate = now;

d = timeseries(c,symbol,{startdate,enddate});

d is a table that contains the RavenPack News Analytics data.

To retrieve more than 3 days of historical news data, use the RavenPack News Analytics Data Feed Tool.

Display the first four variables of the first record of historical data.

d(1,1:4)
ans =

  1×4 table

       TIMESTAMP_UTC        RP_ENTITY_ID    ENTITY_TYPE     ENTITY_NAME 
    ____________________    ____________    ___________    _____________

    13-May-2018 15:30:32       12E454          COMP        Facebook Inc.

Each row in the table is one record of news data. Here, the first four variables specify a news event on May 13, 2018 about a company.

List the variables in the data.

d.Properties.VariableNames
ans = 

  Columns 1 through 4

    'TIMESTAMP_UTC'    'RP_ENTITY_ID'    'ENTITY_TYPE'    'ENTITY_NAME'

  Columns 5 through 9

    'POSITION_NAME'    'RP_POSITION_ID'    'COUNTRY_CODE'    'RELEVANCE'    'TOPIC'

  Columns 10 through 14

    'GROUP'    'TYPE'    'SUB_TYPE'    'PROPERTY'    'EVALUATION_METHOD'

  Columns 15 through 20

    'MATURITY'    'CATEGORY'    'ESS'    'AES'    'AEV'    'ENS'

  Columns 21 through 24

    'ENS_SIMILARITY_GAP'    'ENS_KEY'    'ENS_ELAPSED'    'G_ENS'

  Columns 25 through 28

    'G_ENS_SIMILARITY...'    'G_ENS_KEY'    'G_ENS_ELAPSED'    'EVENT_SIMILARITY...'

  Columns 29 through 32

    'NEWS_TYPE'    'SOURCE'    'RP_STORY_ID'    'RP_STORY_EVENT_I...'

  Columns 33 through 38

    'RP_STORY_EVENT_C...'    'PRODUCT_KEY'    'COMPANY'    'ISIN'    'CSS'    'NIP'

  Columns 39 through 46

    'PEQ'    'BEE'    'BMQ'    'BAM'    'BCA'    'BER'    'ANL_CHG'    'MCQ'

For details about each variable in the table, see RavenPack News Analytics User Guide and Service Overview in the RavenPack Developer Zone Overview.

Close the RavenPack News Analytics connection.

close(c)

Create a RavenPack News Analytics connection c using the user name username and password pwd.

c = ravenpack('username','pwd');

Set the data return format to timetable using the DataReturnFormat property of the ravenpack object.

c.DataReturnFormat = 'timetable';

Retrieve RavenPack News Analytics data for the last 15 minutes. Here, the symbol is set to the entitled symbol (entity-scores :rpna-4.0-eqt). The start date is set to 15 minutes ago. The end date is the current date and time. d is a timetable that contains the RavenPack News Analytics data.

symbol = '(entity-scores :rpna-4.0-eqt)';
startdate = now-.01;
enddate = now;

d = timeseries(c,symbol,{startdate,enddate});

Display the first three variables of the first record of intraday data.

d(1,1:3)
ans =

  1×3 timetable

       TIMESTAMP_UTC        RP_ENTITY_ID    ENTITY_TYPE     ENTITY_NAME 
    ____________________    ____________    ___________    _____________

    14-May-2018 15:04:15       12E454          COMP        Facebook Inc.

Each row in the timetable is one record of news data. Here, the first three variables specify a news event on May 14, 2018 about a company.

List the variables in the data.

d.Properties.VariableNames
ans =

  1×45 cell array

  Columns 1 through 5

    {'RP_ENTITY_ID'}    {'ENTITY_TYPE'}    {'ENTITY_NAME'}    {'POSITION_NAME'}    {'RP_POSITION_ID'}

  Columns 6 through 11

    {'COUNTRY_CODE'}    {'RELEVANCE'}    {'TOPIC'}    {'GROUP'}    {'TYPE'}    {'SUB_TYPE'}

  Columns 12 through 17

    {'PROPERTY'}    {'EVALUATION_METHOD'}    {'MATURITY'}    {'CATEGORY'}    {'ESS'}    {'AES'}

  Columns 18 through 23

    {'AEV'}    {'ENS'}    {'ENS_SIMILARITY_…'}    {'ENS_KEY'}    {'ENS_ELAPSED'}    {'G_ENS'}

  Columns 24 through 27

    {'G_ENS_SIMILARIT…'}    {'G_ENS_KEY'}    {'G_ENS_ELAPSED'}    {'EVENT_SIMILARIT…'}

  Columns 28 through 32

    {'NEWS_TYPE'}    {'SOURCE'}    {'RP_STORY_ID'}    {'RP_STORY_EVENT_…'}    {'RP_STORY_EVENT_…'}

  Columns 33 through 40

    {'PRODUCT_KEY'}    {'COMPANY'}    {'ISIN'}    {'CSS'}    {'NIP'}    {'PEQ'}    {'BEE'}    {'BMQ'}

  Columns 41 through 45

    {'BAM'}    {'BCA'}    {'BER'}    {'ANL_CHG'}    {'MCQ'}

For details about each variable in the timetable, see RavenPack News Analytics User Guide and Service Overview in the RavenPack Developer Zone Overview.

Close the RavenPack News Analytics connection.

close(c)

Input Arguments

collapse all

RavenPack News Analytics connection, specified as a connection object created using ravenpack.

RavenPack entitled symbol, specified as a character vector, string scalar, or cell array with one character vector.

Data Types: char | cell | string

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

Example: now-.01

Data Types: double | char | string | datetime

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

Example: now

Data Types: double | char | string | datetime

RavenPack fields list, specified as a character vector, string scalar, cell array of one or more character vectors, or string array. Each character vector corresponds to a RavenPack field. The fields determine the news data to return. For details about the fields, contact RavenPack.

Example: {'ENTITY_NAME','CATEGORY','SUB_TYPE'}

Data Types: char | cell | string

Output Arguments

collapse all

RavenPack News Analytics data, specified as a table.

Tips

  • Before creating a RavenPack News Analytics connection:

    • Start the RavenPack Data Gateway process.

    • Add the full path of the Data Gateway Client JAR file to the static or dynamic Java® class path.

    For details, see ravenpack.

  • If you encounter this error, decrease the date range using the input arguments startdate and enddate.

    Java exception occurred:
    com.ravenpack.data.DataGatewayException: TIMEOUT
    while invoking remote function:
    jl-api.getQuoteRange
    

Introduced in R2015b