Historic Options data - Python

Hi. Im trying to download historic options data. Ive found that I can open the data in Eikons chart app with the example ticker QHYGH171808500.U^H18

[for the ticker HYG -17Aug2018 strike 85]

but I cant seem to be able to access this data through Python

#--trying every possible header I can find for any result--

fields = ['DSPLY_NAME','EXPIR_CYCL','CF_DATE', 'TR.CLOSEPRICE', 'EXPIR_DATE', 'PUTCALLIND', 'STRIKE_PRC', 'CF_CLOSE','IMP_VOLT','CF_VOLUME','OPINT_1']

df = ek.get_data('HYGH171808800.U^H18',fields)


Not sure if I'm doing something wrong or if this is not possible.

If its not possible how do I download this through the Excel data stream?

Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    @bchip

    The historical data for this RIC is available through the get_timeseries method.

    df = ek.get_timeseries(["HYGH171808500.U^H18 "],start_date="2017-07-01", end_date="2018-08-17", interval="daily")

    image

Answers