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

Upvotes
Accepted
83.1k 281 53 77

@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 1 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
83.1k 281 53 77

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