Shares of Apple (AAPL 1.59%), the world's most valuable company, popped last month. The stock gained early in the month as the company reported fiscal fourth-quarter earnings, and trended with the S&P 500 over most of the rest of the month.

A weaker-than-expected October inflation report drove Apple stock higher in the middle of the month as the iPhone maker depends on consumer discretionary spending, and consumers have more money to spend when inflation is lower.

According to data from S&P Global Market Intelligence, the stock finished the month up 11%. The chart below shows its performance over the course of the month.

^SPX Chart

^SPX data by YCharts.

Apple rides the rebound

The main news out on Apple in the early part of the month was its fourth-quarter earnings report. It showed solid numbers, topping estimates on the top and bottom lines, but the stock actually pulled back slightly on the news, falling 0.6% on Nov. 3 after two straight days of strong gains to open the month.

Apple reported record iPhone revenue in the quarter, while overall revenue was down 1% to $89.5 billion, but that was better than expectations at $89.35 billion. On the bottom line, meanwhile, the continuing emergence of its services segment helped drive margins higher, and earnings per share increased by 13% to $1.46, ahead of the consensus at $1.39.

Analyst response to the report was mixed, with a number of Wall Street watchers lowering their price targets on the stock to adjust for its earlier pullback in September and October.

Over the rest of the month, there was not any major news on Apple, but the stock benefited from cooling inflation and hopes that interest rates would come down because the company is more sensitive to consumer spending than its big tech peers.

Investors continued to keep a close eye on the company's performance in China, and are anxious to see how the new iPhone 15 does as well as the much-anticipated Vision Pro mixed-reality headset, which is due out early next year.

Can Apple keep moving higher?

The stock continued to move higher in early December, approaching an all-time high, and shares are expensive, trading at a price-to-earnings ratio of 31, but Apple has proved it deserves to trade at a premium even with flat revenue as it has tremendous pricing power, and the services segment should continue to drive growth on the top and bottom lines.

While the stock might be a bit stretched at the current valuation, it still looks like a good long-term bet.