How can I get the historical weights from Bloomberg using the Datafeed Toolbox?

28 views (last 30 days)
In the classic Bloomberg add-in, the following request :
=BDS("SPX Index";"Indx_mweight_hist";"end_dt";20070506;"cols=2;rows=500")
gives you the historical weights of the 500 constituents of the SPX Index at the 6th may of 2007.
Note the presence of a optional field "end_dt" which enables declaring a specific date.
I tried to replicate this in the Datafeed Toolbox but it does not work. By trying some formulae, I just managed to get the current date constitution with the following :
c=bloomberg;
e=fetch(c,'SPX Index','GETDATA','Indx_mweight_hist');
But this is not the historical request as the one shown above.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 23 Jan 2012
If you are using the older BLOOMBERG command, you can get historical weights using the following code:
d = fetch(c,'SPX Index','GETDATA',{'INDX_MWEIGHT_HIST'},{'END_DT'},{'20070506'});
You can find a list of 'override' fields in the Datafeed Toolbox user interface using the function DFTOOL. There is an 'override' button on the 'data' panel. The 'override' fields cause the Datafeed Toolbox to alter the returned data based on the field value.
If you are using the newer BLP command, you can replace the FETCH method with the GETDATA method using the following code:
b = blp;
d = getdata(b,'SPX Index',{'INDX_MWEIGHT_HIST'},{'END_DT'},{'20070506'});
Note that with the newer API users should consult the Bloomberg documentation or Bloomberg support directly to find a list of 'override' fields for the GETDATA command.

More Answers (0)

Tags

No tags entered yet.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!