New posts are disabled while we improve the user experience.
You can browse the site, or for urgent issues, raise a query at MyAccount.
The call to get chain constituents can be simplified compared to the example @chavalit.jintamalit provided.
tmp_df, err = ek.get_data('0#LCO:',['DSPLY_NAME'])Then to use the chain constituents to retrieve timeseries of price history we need to select 'Instruments' column from the dataframe returned by get_data method, convert series to list and drop the first element of the list because the first constituent of this chain is not a future RIC - it's the RIC providing total volume and open interest for all Brent futures.
futures = tmp_df['Instrument'].tolist()[1:]Finally for a short time span we can retrieve the timeseries for all Brent futures using a single call.
ek.get_timeseries(futures, start_date='2019-07-01', end_date='2019-08-01')However, since get_timeseries method returns a max of 3K rows which is shared by all instruments in the call, to retrieve a longer time span of price history we need to split the list of RICs into smaller chunks and request price history separately for each chunk. In practice it may be best to retrieve timeseries of price history for each individual RIC.
0#LCO: is a chain RIC.
You can get all the underlying RIC by following this code:
Then you can get time series on each individual underlying RIC code: