rd.get_history for currencies?

why oh why !!!!

ek.get_timeseries worked (somehow) for all RICS you threw at it.

i.e. :

ek.get_timeseries(['AUD=', 'IBM'], start_date=str('2023-01-01'), end_date=str(tsClosingDate), interval='daily', fields = fieldsToReturnEK)

rd.get_history does ... not ... besides all the undocumented idiosyncrasies.

rd.get_history(universe=['AUD='], fields=fieldsToReturnRD, parameters={"SDate": str('2023-01-01'), "EDate": str(tsClosingDate), "Fill": "None"},use_field_names_in_headers=True)

How can i get currencies from rd.get_history ?

Separate loop?

Stomach churning pain in the backside ...

Thanks for pointers


Best Answer

Answers

  • @the.swiss

    Thank you for reaching out to us.

    Please try this one.

    rd.get_history(universe="AUD=",
                   count=10, 
                   interval='1D',
                   fields = ["BID", "BID_HIGH_1", "BID_LOW_1", "OPEN_BID", "NUM_BIDS"])


  • PS:
    1700831309432.png

    ,

    thanks Jirapongse

    Doesn't work for non CCYs

    Let me ask the question differently then. Is there a list of fields the works for this:

    ['AUD=', 'IBM', '.dMIWO000S0GUS', 'AEDCHF=R', 'ZURN.S', 'LP65123696', 'TWGGX.O', '/FSMIH5']

    to get O,H,L,C and Volume at least?

    Or do i have to run through each asset class and cobble together the fields?

    Is there documentation anywhere?

    Cheers

    Alfred

  • @the.swiss

    There are two sets of fields (TR fields and real-time fields).

    The TR fields are prefixed with "TR.", such as TR.OPENPRICE. The real-time fields don't have the TR. prefix, such as OPEN_PRC.

    The TR fields can be retrieved via the Fundamental and Reference endpoint and the output is similar to the =TR function in Eikon Excel. Some TR fields can provide historical data. You can use the Data Item Browser tool to search for the TR fields.

    Some historical real-time fields can be retrieved via the historical endpoint and the output is similar to the =RHistory funciton in Eikon Excel.

    The rd.get_history can retreive data from both endpoints depending on the requested fields.

    Each RIC can provide different views of historical real-time data and there is one default view for each RIC. For example:

    • AUD= can provide historical real-time data for several views, such as Bid, Ask, Bid America, BID Asia, Bid europe, and Mid price and the default view is Bid.
    • IBM can provide historical real-time data for several views, such as Bid, Ask, Trade price, Vwap, and Yield and the default view is Trade price.

    The ek.get_timeseries data can only retrieve data from the default view so it can map the values in the default view to OPEN, HIGH, LOW, and CLOSE fields.

    1701062995198.png

    However, the historical endpoint used by the Refintiv Data Library can retreive historical real-time data for all views and it uses the real-time fields to represent the data. Therefore, the output will have all available fields, if you don't specify the fields parameter.

    1701063046834.png

    You can set an array of RICs in the universe parameter.

    rd.get_history(universe=['AUD=', 'IBM'],
                   count=10, 
                   interval='1D')

    The code above doesn't have the fields parameter so the response will contain all available historical real-time fields for each RIC.

    For your question, if you need to get the historical BID OHLC fields for AUD=, you need to use these BID, BID_HIGH_1, BID_LOW_1, OPEN_BID, NUM_BIDS fields. However, if you need to get the historical Trade OHLC fields for IBM, you need to use these TRDPRC_1, HIGH_1, LOW_1, ACVOL_UNS, and OPEN_PRC fields.


  • Hi Jirapongse

    Thanks for the quick answer.

    tried that, I think, and RD did not return anything other than TR fields, or so i believe.

    Am tied up all week and will try a few things next week, but basically I came to the conclusion that I have to have a loop for each type of asset (CCY, equity, future, bond, …) and define best environment (EK, RD) and the commensurate fields to return.

    Btw - there doesn‘t seem to be a bijective field for asset type (~TypeCode)

    Cheers again

    Alfred

  • found a very tedious way around the limitations.

    TR.* and non TR.* fields don't mix in RD universe

    Is there usable documentation anywhere?

    Cheers