The U.S. stock market has been highly resilient in the face of macroeconomic and tariff uncertainty in the last few years. Since the beginning of 2023, the S&P 500 index (^GSPC 0.48%) has posted close to a 70% total return, marking one of the best two-and-a-half-year periods in stock market history.
Does that mean the market is overheating? The S&P 500 average price-to-earnings multiple is inching back close to all-time highs, putting large expectations on future growth for its underlying companies. As an investor, it can pay to have a level head and act rationally when the stock market is going on a roller-coaster ride (in either direction).
Here are three things not to do with stocks at all-time highs to help you position your portfolio and succeed over the long term.
Don't go to all cash
A famous investing adage is, "you don't go broke taking a profit." While that is technically true, cutting short your returns on huge winning stocks can severely hamper your long-term returns, while also adding a large tax hit that is underappreciated by many stock investors. The huge winning returns in the market come from holding high-quality businesses such as Amazon, Netflix, or Nvidia for decades. If you bought and then sold them only after a double, you would be missing out on 100-fold returns.
In other words, don't take your portfolio entirely to cash just because stocks are back at all-time highs. When looking at historical data, there is barely a difference between forward returns over one-, three-, and five-year periods when you buy the stock market at all-time highs compared to any other period.
This is a quantitative example of why investors should not try to time the market. It is close to impossible, doesn't truly impact your long-term returns, adds new tax implications, and is much more stressful than buy-and-hold investing. That's not a winning formula for stock investing. Stay patient and let your winning stocks keep riding to new heights.

Image source: Getty Images.
Don't trade with leverage
Rising stocks can give you confidence. Sometimes, this can lead to irrational exuberance, and it is important to keep a level head even if you feel like a stock market genius right now.
One thing to not do -- and perhaps the most important lesson all investors should take from reading this article -- is to avoid going on margin to buy more stocks. Trading on margin means getting a loan from your brokerage to buy more stocks. For example, you may have $100,00 in cash deposited in your account but take on $50,000 in loans to buy more from your brokerage. Margin debt for investors has hit a record high in 2025.
You can look really smart buying on margin when stocks go up, but it can add stress and lead to disastrous results in times of market volatility. If stocks go down aggressively -- like they did in April during the tariff uncertainty -- your stock brokerage may issue a margin call, which requires you to deposit more cash into your account to cover losses on your loans. Or, if you cannot deposit cash, your broker has the right to take ownership of your stocks and sell off your positions, which can send your account to zero.
You never want your account to go to zero; it is a disastrous situation that can eliminate years and years of returns. Avoid taking out margin loans to buy stocks, even if you feel like a genius with your portfolio soaring in the last few years. When a bear market occurs -- as it always inevitably does -- you may get liquidated by your brokerage. Stay stress-free and simply buy and hold stocks without taking on debt to do so.
SPY Total Return Level data by YCharts
Don't ignore valuation when buying
The last lesson for investors when investing at all-time highs is to pay attention to valuation when analyzing a stock. Ignoring valuation can be an easy thing to do when stocks seem to only go up, but it will matter eventually over the long term.
For example, you could have a stock like Palantir Technologies. Shares are up over 2,000% since the start of 2023, making it one of the best-performing stocks over that time period. It was a fantastic investment if you bought a few years ago. But you shouldn't buy it today without looking at its valuation.
A quick look shows that Palantir may be the most overvalued stock on the market right now. It has a price-to-sales (P/S) ratio of over 100, which is a recipe for terrible long-term returns for those who buy today. Ignoring valuation may lead you into dangerous territory to buy stocks such as Palantir. If you keep a level head and do not ignore valuation when deciding which stocks to buy, you can avoid buying these risky stocks for your portfolio.
Don't hide in cash, don't trade with leverage, and don't ignore valuation. These are three lessons you can take to make smart, rational investing decisions with the stock market soaring.