Commonwealth Bank of Australia (ASX: CBA) shares have been on a handy run of late. Shares in Australia's biggest bank are up 18.8% year-to-date and 37.3% in the last year.
Investment decision-making is a very individual process and whether or not to buy will vary greatly depending on financial position, investment horizon and investment strategy.
However, the bank's shares are trading just shy of $100 per share and aren't far off an all-time high. So, is it a good time to buy CBA shares?
When is a good time to buy CBA shares?
Some investors may be wary of purchasing CBA shares so close to an all-time high. However, an all-time high isn't a bad thing in and of itself.
For instance, in order for a share price to continue climbing over time, you'd expect it to be at an all-time high at several points. That means that record highs, or even 52-week highs, aren't something to be afraid of.
What might help in assessing CBA shares right now is the relative value that they offer versus peers. A comparable peer group for CBA could be its fellow Big Four banks.
CBA shares currently trade at a price to earnings (P/E) ratio of 22.1 times earnings with a 2.5% dividend yield. Let's see how that stacks up against Australia and New Zealand Banking Group Ltd (ASX: ANZ), National Australia Bank Ltd (ASX: NAB) and Westpac Banking Corp (ASX: WBC).
Based solely on the P/E ratio, ANZ is the best value at 16.8x earnings compared to NAB (19.9x) and Westpac (21.1x). For those hunting for income, ANZ also leads the pack with a 3.8% dividend yield. CBA (2.5%) is notably the lowest with NAB (3.5%) and Westpac (3.6%) both trading higher.
Based purely on these metrics alone, it does look like CBA shares are trading at a slight premium to their peers. CBA's 22.1x P/E ratio is above the group average of 20.0x with a lower dividend yield. However, investing isn't as easy as buying whatever is cheapest based on a couple of easy numbers.
There are many reasons why a share may trade at a premium to its peers. For instance, a large price drop would be bad for total returns but if the earnings and dividends estimates remained unchanged, the relative value would look more attractive.
P/E ratios and dividend yields could also be reflecting demand for greater governance, a stronger capital position, a better balance sheet or even a preferred strategy.
Foolish takeaway
Whether now is a good time to buy CBA shares will depend on the individual.
There's no doubt they've performed well in the last year or so and aren't far away from an all-time high. If I were considering buying, I'd keep a close eye on CBA's full-year results on 11 August.