# how to get modify the following correlation matrix with a specific list of financial prices?

The following takes the last 5 members of the Dow Jones index and plots the correlation matrix of the last 5 years of daily prices:

mem = FinancialData["^DJI", "Members"];
findata =
FinancialData[#, "Price", {{2007}, {2012}, "Day"}][[All, 2]] & /@
mem[[-5 ;; -1]];
fincm = Correlation[Transpose@findata];

tb = Map[Item[NumberForm[#, 2],
Background ->
ColorData["TemperatureMap"][Rescale[#, {-1, 1}]]] &, fincm, {2}];
tb = Prepend[tb, mem[[-5 ;; -1]]];
tb = Join[List /@ Prepend[mem[[-5 ;; -1]], ""], tb, 2];
GraphicsGrid[tb, ImageSize -> 500, Frame -> All]


But what if I want to compare 5 specific equities instead from various listed exchanges; i.e CWC.L, CAP.PA, IFX.DE, ISYS.L and LAD.L?

Anyone?

-

You just need to find the correct names for the equities you're interested in using, for instance :

FinancialData["*CWC*", "Lookup"]


Then you can define :

equities = {"L:CWC", "PA:CAP", "DE:IFX", "L:ISYS", "L:LAD"};

findata = FinancialData[#, "Price", {{2007}, {2012}, "Day"}][[All, 2]] & /@
equities;

-
Hi @b.gatessucks I tried to use your solution but somehow it is not working. Can you post the complete changes instead of partially stating the change in only the first two lines? There are more dependencies further along the code. Thanks –  sebastian c. Oct 28 '12 at 21:35
It's because the different data sets have different length. It's up to you how you want to fix this; for instance, you can take the most recent n data points, where n is the minimum length. Alternatively you can use only data relative to the common dates, which you can get with Intersection. Make an effort and come back with a specific question if you get stuck. –  b.gatessucks Oct 29 '12 at 8:15