Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 1 1

Obtain FX rate "mid_price.close" from API

We currently obtain an FX rate using an Excel macro -- the key part is this:

xll.rhistory(...rics...,"MID_PRICE.Timestamp;MID_PRICE.Close"...

We're trying to get the same figures through a Python API. The Eikon API doesn't have 'mid-price'. The Refinitiv data API has 'mid-price' but not 'mid-price.close'.

Using rd.get_history without specifying fields gives a range of rates, none of which match the rates we get from Excel.

Using ek.get_timeseries or ek.get_data only gives close, high, low and open -- none of which match the Excel rates either.

Is there a way of obtaining the 'MID_PRICE.Close' Excel macro figure through a Python API?

eikon-data-apiapirefinitiv-data-platformexcel
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.

Hello @operations04

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,
AHS

Upvotes
Accepted
78.6k 248 52 74

@operations04

Thanks for reaching out to us.

I checked with JPY= and found that the MID_PRICE from rd.ge_history matches 'MID_PRICE.Close'

The following is the data from rd.get_history.

1666236896220.png

Then, comparing the data from Excel.

1666236937159.png


Please provide sample RICs that data from rd.get_history is different from Excel.


1666236896220.png (26.7 KiB)
1666236937159.png (34.0 KiB)
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
1 0 1 1

Thank you for the response. And apologies for not being more specific!

One RIC that exhibits the problem is EURGBP=


fx-discrepancy.jpg


The data on the left comes from the Refinitiv-Data API, using:

rd.get_history(['EURGBP='], interval='daily', end='2022-10-18', count=4)

And the data on the right comes from an Excel macro, using:

_xll.rhistory($B$3:NQ$3,"MID_PRICE.Timestamp;MID_PRICE.Close"...


Please let us know if any more information would be helpful in diagnosing what's going on here.

Thank you.


fx-discrepancy.jpg (55.5 KiB)
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
78.6k 248 52 74

@operations04

Thank you for the information.

I am not sure about _xll.rhistory. I used @RHistory method in Eikon Excel.

=@RHistory("EURGBP=","MID_PRICE.Timestamp;MID_PRICE.Close","INTERVAL:1D",,"TSREPEAT:NO CH:Fd",F8)

The output is:

1666259332128.png


1666259332128.png (42.3 KiB)
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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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