Get maximum price of stock within a date range

How can I use Eikon API to extract maximum price of stock over a specfic date range? I am using python to extract the maximum price.

Best Answer

  • @f.hashim

    You can do it directly on a dataframe

    df,err = ek.get_data('VOD.L',['TR.HIGHPRICE','TR.HIGHPRICE.date'],{"Sdate":'2020-01-01', "Edate":'2020-09-10'})
    df[df['High Price']==df['High Price'].max()]

Answers

  • Hi @f.hashim

    For the today high, you can use get_data() and use "HIGH_1" field.

    image

    For historical data, you can use get_timeseries() and use "HIGH" field.

    image

  • I need to get maximum value from the time series is there a field that can give a maximum of `HIGH` field over a specific date range?