Apple (AAPL 0.51%) was the last significant large-cap tech company to report its results in what turned out to be a frightful week of earnings for tech companies right before Halloween. But, unlike its peers, it surprised a pessimistic market by posting excellent results and beating analysts' top and bottom-line forecasts.

However, even though the stock seems immune to this terrible downturn, investors should be cautious about investing in Apple today for these two reasons.

1. Significant headwinds from the strong dollar

The strong dollar has two negative impacts on U.S.-based companies.

First, a strong U.S. dollar makes products exported from the U.S. more expensive for consumers in other countries, especially in emerging markets -- resulting in lower demand for U.S. exports. For example, a stronger dollar means that Apple has a lower demand for iPhones, iPads, Macs, and other products in foreign markets.

Second, a strengthening dollar means foreign revenues will translate into less cash when the company returns the funds to the U.S. market -- a significant reason why many U.S. companies report an earning miss during times when the dollar is strengthening.

The main reason today for a strengthening dollar is rising interest rates. When interest rates rise in the U.S., it makes dollar-denominated investments more attractive to foreign investors -- strengthening the dollar. And as long as the Federal Reserve continues fighting inflation by aggressively raising interest rates, the dollar will continue to strengthen.

The Federal Reserve recently boosted interest rates by 3/4 of a percentage point on Nov. 2. Moreover, it hinted that it would continue raising rates until inflation recedes. The result? Essentially every currency worldwide continues to weaken against the dollar. That's bad for Apple product demand in markets outside the U.S.

2. Worsening macroeconomy

During the first half of the year, Apple battled the highest inflation in the U.S. for decades, with the inflation rate peaking at 9.1% in June. Inflation is bad for manufacturers like Apple, as rising wages, soaring commodity prices, and high logistics costs negatively impact it on the cost side. And inflation also decreases consumer purchasing power, lowering demand and slowing sales.

Then things got worse.

Over the second half of 2022, the Federal Reserve's six interest rate hikes choked off economic growth, and many think the economy will slow further in 2023. If you listen to the forecasts from the International Monetary Fund (IMF), its World Economic Outlook sees a broad global slowdown next year, with the worst yet to come. Although the IMF is not predicting a recession, it believes 2023 will feel like a recession for many people.

But Apple has held up well so far

Apple's stock has held up much better than its large-cap tech peers. Its stock has only declined around 18% year to date; in comparison, fellow large-cap tech rivals are down anywhere from 30% to 70%. The reason for Apple's outperformance? The business has yet to deteriorate as much as its competitors. Despite the terrible economy and strong dollar, the company has an extraordinarily loyal fanbase that continues to buy its new products and services.

In the September quarter, its most significant product, the iPhone, grew 10% over the previous year's comparable period to a September quarter record of $43 billion. Particularly notable was that emerging markets like India set a new all-time revenue record. In addition, Thailand, Vietnam, Indonesia, and Mexico more than doubled year over year. Finally, the Mac segment's 25% year-over-year growth to an all-time revenue record of $11.5 billion was even more awe-inspiring for Apple investors.

Expect little near-term upside

However, if you are looking to buy the stock soon, you should be more concerned about valuation and its prospects over the next year. Apple's price/earnings to growth (PEG) ratio stands at 2.69. In general, many investors consider a PEG ratio substantially over 1 a sign of an overvalued stock.

Additionally, Chief Financial Officer Luca Maestri said on the September quarter conference call that the company expects a sequential growth slowdown during the quarter ending in December. He attributed the expected slowdown to unfavorable currency impacts, tough comparisons for the Mac business, and macroeconomic pressures on the services business, especially digital advertising and gaming.

Considering online media company Insider recently reported that Apple would pause most hiring until September 2023, investors should take that as a sign that the company is battening down the hatches, preparing for a further downturn. Consequently, it might be best if you rethought buying this stock at current prices; should the economy worsen as expected and Apple's earnings shrink, the stock will likely drop from its recent high valuation.