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"}
  )

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

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

Answers

  • elie
    elie Newcomer

    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


  • Jirapongse
    Jirapongse ✭✭✭✭✭

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

  • elie
    elie Newcomer

    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