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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
9 0 0 0

Open interest despite the closing price

Hi all,

I want to make chart of an open interest of eua call options at level 40. In Eikon Refinitiv this option has ric EFOM4000C1, and in eikon it is possible to chart open interest of that ric


With the python code below, i get the price of this option. How to setup the code for an open interest?


ric_eua_calls_40='EFOM4000C1'


eua_calls_40=ek.get_timeseries(ric_eua_calls, start_date='2020-01-01T07:00:00',

interval='daily')

eua_calls_40.tail()

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

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

Upvote
Accepted
39.2k 75 11 27

Rather than using get_timeseries method of Eikon Data APIs, which only provides timeseries for default view (or data item) for an instrument (typically this is instrument's trade price), you need to use RDP Libraries, e.g.

rdp.get_historical_price_summaries(
        universe = 'EFOM4000C1',
        fields = ['TRDPRC_1','SETTLE','OPINT_1'],
        start = '2020-01-01',
        end = '2021-02-26')
icon clock
10 |1500

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

Upvotes
9 0 0 0

Thank you, i tried that rdp library and it works well and showed all the data that i need.

The only problem with that library (in the previous ek.get_timeseries it worked normaly) is that it gives me those numbers as strings, so i cant do any operations that i want

So the code below will not create a graph in matplotlib, because the numbers are not integers.

How to chart that time series with the matplotlib package? Thank you


option=rdp.get_historical_price_summaries(

universe ='EFOM5000L1',

fields = ['OPINT_1'],

start = '2020-01-01' )


option.plot()

pyplot.show()

icon clock
10 |1500

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

Upvote
39.2k 75 11 27

It's very easy to convert strings returned by get_historical_price_summaries method to numeric values. Just add the following line before creating a plot for the dataframe

option = option.apply(pd.to_numeric)
icon clock
10 |1500

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

Click below to post an Idea Post Idea