historical open interest in eikon python api

Your Question: How do I pull historical open interest in eikon python api? I found the code in excel NDA_RAW.Nda_open_interest. But this field does not work in python

ek.get_timeseries([TYH8^1],[NDA_RAW.Nda_open_interest],start_date = '2018-01-01',end_date = '2018-04-01')

returns NaN

Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    @dionchu

    The ek.get_timeseries method supports the following fields: 'TIMESTAMP', 'VALUE', 'VOLUME', 'HIGH', 'LOW', 'OPEN', 'CLOSE', 'COUNT'. For more information, please refer to Eikon Data APIs for Python - Reference Guide.

    To get historical open interest, you can use the ek.get_data method.

    df, e = ek.get_data('TYH8^1', ['TR.OPENINTEREST.Date', 'TR.OPENINTEREST'], {'SDate':'2018-01-01','EDate':'2018-04-01'})

Answers