How do I retrieve all of the index member names from Bloomberg using the Datafeed Toolbox?
2 views (last 30 days)
Show older comments
I am looking for a way to display something like the S&P500 index members in MATLAB using the Datafeed Toolbox.
Accepted Answer
MathWorks Support Team
on 22 Sep 2009
The following code demonstrates how you may display the S&P500 members in MATLAB using the Datafeed Toolbox.
B = bloomberg
D = fetch(B,'SPX Index','GETDATA','INDX_MEMBERS');
D.INDX_MEMBERS{:}
This returns the securities that make up the S&P500 index.
Here is an example of the override parameter to return the securities for a particular date.
B = bloomberg
d = fetch(B,'SPX Index','GETDATA','INDX_MWEIGHT',{'END_DT'},{'20080919'});
Please note that the 'END_DT' override is not a valid override for the 'INDX_MEMBERS' field. Thus, adding this override to your request does not change the content of 'INDX_MEMBERS'. If you would like the index members for a particular date, the following code illustrates how to accomplish this with 'INDX_MWEIGHT':
B = bloomberg
d = fetch(B,'SPX Index','GETDATA','INDX_MWEIGHT',{'END_DT'},{'20080919'});
members = d.INDX_MWEIGHT{1};
0 Comments
More Answers (0)
See Also
Categories
Find more on Bloomberg Desktop in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!