Commodity Term Structure Data from Bloomberg

841 views Asked by At

I am looking for a way to download daily WTI crude oil (CL) term structure data from Bloomberg in the Excel Add-in.

My goal is to create a table that looks like this: For each futures contract, I want the lat price and the days to maturity.

Date CL1 CL2 ...
1.1.12 PX_Last FUT_ACT_DAYS_EXP PX_Last FUT_ACT_DAYS_EXP

I have tried the FUT_ACT_DAYS_EXP code but for historical price series it is not available. Is there maybe a different way to receive the term structure data with days to maturity from BB?

Many thanks!

2

There are 2 answers

0
DS_London On BEST ANSWER

The generic contract CL1 Comdty has a historic field of FUT_CUR_GEN_TICKER. So you can pull back a timeseries of PX_LAST and FUT_CUR_GEN_TICKER.

enter image description here

Then you can feed these underlying contract tickers into a BDP call for LAST_TRADEABLE_DT and subtract the PX_LAST date. You can hide the intermediate columns if they are not needed.

enter image description here

And the final result, with the intermediate column D hidden:

enter image description here

NB. I'm using array functions here (note the # symbols in the formulae), rather than hard-coding ranges. It makes it more flexible if you want to change the history range. The multiple BDP calls are unnecessary but the Bloomberg addin may be caching them in any case. If performance is an issue you can use the UNIQUE() function to get a list of the underlying contract names into a lookup table.

0
Morgan Williams On

It's been a few years since I looked at this but you are using generic tickers, whereas FUT_ACT_DAYS_EXP would most likely expect an actual contract, e.g. CLU1. There is a field that you can use to convert generic to actual as a time series, i.e. with BDH, but you would have to check that on FLDS. Once you have that you can use BDH to pull in price and days to expiry. Bear in mind that with one BDH per date this would be a very inefficient approach with regards to limits .

Alternatively ask HELP HELP and they should give you a solid answer. Unfortunately I don't access to the terminal anymore but I used to be very involved in building such analytics.