Can Eikon Python API call historical forward values? i.e. what M+5 Brent was on the 01/01/2019 like

Can Eikon Python API call historical forward values?

i.e. what M+5 Brent (0#LCO:) was on the 01/01/2019 like Eikon Forward Curve Chart app does.

Best Answer

  • @dmitry.pak2

    You can construct expired future RICs for the curve date and use these RICs to retrieve close values of those futures as of the curve date. E.g. the 5th nearest contract on 01/01/2019 was the Jun19 contract (RIC LCOM9^1). The following code snippet retrieves the close value for this future as of 01/01/2019.

    curve_date = dt.datetime(2019,1,1)
    ek.get_timeseries('LCOM9^1', 'CLOSE', start_date=curve_date + dt.timedelta(-10),
                      end_date=curve_date, count=1)