The weights of your stocks can play a big role in your investment strategy. Here’s how to calculate them