Lets look at the goldies over 12 months. You can see how they move together. This relationship between each of them can be put into a straight line through what is called regression. If the relationship between two companies is perfect as in when one moves up the other moves up also then they get a correlation r2 = 1.0.
If I make lots of straight lines comparing each of the companies I can then make up a correlation matrix.
These then could be sorted and by using the top 6 correlated companies I made up those charts. It is far from perfect and the next couple of weeks I am going to sieve through the companies that the program can sort from.