question

Upvotes
Accepted
1 0 4 5

timeseries data in RDP

Hi
Currently i get data (Open, Close, EV, MC) for a list of tickers (on daily basis) by using ek.get_data

I want to get rid of opening eikon toolbar, how can I get this data with rdp?

Thanks

  fields = ["TR.PriceClose.date;TR.PriceOpen;TR.PriceClose;TR.EV;TR.CompanyMarketCap"]
  prices_df,err = ek.get_data(
  ric, fields, {"SDate": start_date, "EDate": end_date, "CURN": "USD"}
  )
pythonrdp-apitime-seriesfundamental-datareference-data
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
47.2k 110 44 60

@elie

RDP has the historical-pricing endpoint that can provide historical events, interday, and intraday data.

For fundamental and reference data, RDP has the DataGrid endpoint. The DataGrid endpoint is similar to the get_data method of Eikon Data API but this endpoint is still in beta. For example, the request looks like this:

{
  "universe": [
    "GOOG.O"
  ],
  "fields": [
    "TR.PriceClose.date;TR.PriceOpen;TR.PriceClose;TR.EV;TR.CompanyMarketCap"
  ],
  "parameters": {
    "Scale": 6,
    "SDate": 0,
    "EDate": -3,
    "FRQ": "FY",
    "Curn": "USD"
  }
}

The output is:

InstrumentDatePrice OpenPrice CloseEnterprise Value (Daily Time Series)Company Market CapGOOG.O2021-12-31T00:00:000.002910880.002893591794388.645843661921854.64584366GOOG.O2020-12-31T00:00:000.001735420.001751881067708.042276961185281.04227696


For more information, please refer to the RD library. The example is on GitHub.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks, your answer helps to understand, but cannot be used

This example is slightly more usable

ticker = "AAPL.O"
fields = ["TR.PriceClose.date;TR.PriceOpen;TR.PriceClose;TR.EV;TR.CompanyMarketCap"]
parameters = {
    "Scale": 6,
    "SDate": 0,
    "EDate": -3,
    "FRQ": "FY",
    "Curn": "USD"
  }
response = fundamental_and_reference.Definition(ticker,fields,parameters).get_data()
response.data.df
Upvotes
1 0 4 5

Great, looks like exactly what i need
But from the example on GitHub i do not understand how to open session with rd

refinitiv-data.config.json file very different from the one that i found on pc

i do use rdp, and connection looks like this:

rdp.open_platform_session(

'key',

rdp.GrantPassword(

'email',

'password'))

Please help to solve this


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
47.2k 110 44 60

@elie

You can refer to the examples on GitHub.

The configuration file is available here.

You can set the app-key, username, and password in this file.

    "sessions": {
        "default": "platform.rdp",
        "platform": {
            "rdp": {
                "app-key": "YOUR APP KEY GOES HERE!",
                "username": "YOUR RDP LOGIN OR MACHINE GOES HERE!",
                "password": "YOUR RDP PASSWORD GOES HERE!"
            },

Then, run the Examples/1-Access/EX-1.01.01-GetData.ipynb example. It will load the refinitiv-data.config.json configuration file from the RD_LIB_CONFIG_PATH environment variable.

Otherwise, you can also create a platform session directly, as shown below.

session = rd.session.platform.Definition(
    app_key = APP_KEY, 
    grant = rd.session.platform.GrantPassword(
        username = RDP_LOGIN, 
        password = RDP_PASSWORD
    )
).get_session()

session.open()

rd.session.set_default(session)

Then, open the session, and call the rd.session.set_default(session) to use a platform session as a default session.

For more information, please refer to the Examples/4-Session/EX-4.01.01-Sessions.ipynb example.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Thanks, it works