The U.S. broad market index SPDR S&P 500 ETF Trust (NYSEARCA:SPY) hovers around an all-time high. The Canadian broad market index iShares S&P/TSX 60 Index Fund (TSX:XIU) is also near its all-time high, although it’s down 11% in the past year, it’s faring worse than the S&P 500, which is down about 1% in the same period.

What should investors do with their individual stock holdings when the general market is trading at an all-time high?

Focus on individual companies

Instead of focusing on what the market is doing, investors should focus on the valuation and prospects of their individual holdings. They should calculate their estimated returns and decide if the companies are still worth holding on to.

For example, The Coca-Cola Co (NYSE:KO) is trading at 23.1 times its earnings, so the company is overvalued. The company is expected to grow its earnings per share (EPS) by 3-5% in the foreseeable future, and even if it’s a dividend stalwart, it’s not a good time to buy it.

If you own Coca-Cola shares right now, you will need to decide if a 3% yield and an estimated return of 6-8% are good enough. You can either hold on to your shares or book some profit and rebalance your portfolio as you see fit.

Coca-Cola just hiked its quarterly dividend in March by 6% to US$0.35 per share. The company now pays out 70% of its 2015 EPS, which is a bit concerning. In the future, dividend growth is likely to slow down.

What if you’re a shareholder of National Bank of Canada (TSX:NA)? It’s trading at 9.5 times its earnings, so the bank is about 10% undervalued based on its normal multiple.

The company is expected to grow its EPS by 7% in the medium term and pays an above-average dividend yield of 4.9%. Investors can consider buying shares today.

National Bank’s quarterly dividend is 54 cents per share, which equates to an annual payout of $2.16 per share. Based on that payout and its 2015 EPS, the bank only pays out about 46% of its earnings. This aligns with the other big Canadian banks’ payout ratios of about 50% and maintains a safe dividend for shareholders.

Conclusion

No matter what the market is doing, investors should look at the valuation and prospects of their individual holdings and decide whether to buy, hold, or potentially sell.

Both Coca-Cola and National Bank are A-grade companies with solid balance sheets. Their S&P credit ratings are AA- and A, respectively. They should have no problem maintaining their dividends of 3-4.9%, but Coca-Cola is expensive today with slower expected growth, while National Bank is moderately cheap.

Find out about three good dividend stocks

These three top stocks have delivered dividends for shareholders for decades (and even centuries!). Check out our special FREE report: "3 Dividend Stocks to Buy and Hold Forever". Click here now to get the full story!

NEW! This Stock Could Be Like Buying Amazon In 1997

For only the 5th time in over 14 years, Motley Fool co-founder David Gardner just issued a Buy Recommendation on this recent Canadian IPO.

Stock Advisor Canada’s Chief Investment Adviser, Iain Butler, also recommended this company back in March – and it’s already up a whopping 57%!

Enter your email address below to claim your copy of this brand new report, “Breakthrough IPO Receives Rare Endorsement.”

Fool contributor Kay Ng owns shares of Coca-Cola. The Motley Fool owns shares of Coca-Cola.