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()

Best Answer

  • 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')

Answers

  • 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()

  • 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)