The stock market plunged into a bear market at the fastest pace in history earlier this year, but since the March lows it's been an impressive rally. June was the third consecutive month of gains in the S&P 500, and the benchmark index is entering the second half of the year 39% higher than it was in late March. That's a very impressive rally in just over three months.

However, we're still a long way from even, especially in some of the harder-hit areas of the market. Banks, hospitality stocks, and retail are three examples where valuations remain depressed. If the recent spike in COVID-19 cases is brought under control and the economy continues on the path to a V-shaped recovery, it could certainly result in another leg up in the so-called "reopening stocks."

And, while tech stocks -- especially some of those who gained customers and market share during the pandemic -- are now at all-time highs in many cases, that doesn't mean they've run out of steam. Keep in mind that July also brings the start of second-quarter earnings season, and better-than-expected results could also be a positive catalyst.

The point is that although the market's rebound over the past few months has certainly been impressive, it could continue in July if things go well. And if it does, here are two things to keep in mind.

Older man looking at laptop with happy expression.

Image source: Getty Images.

Don't sell just because your stocks went up

One of the most common mistakes newer investors make is selling stocks just because they've gone up. Just recently, a friend called me and said: "I bought some Dave & Buster's (NASDAQ:PLAY) stock a couple months ago and it's doubled. Should I sell it and take the profits?"

Now, I'm not saying that Dave and Busters is a company I would invest in right now, but the point is that my friend was asking the wrong question. One of the key investing principles investors should know is that the best strategy is to buy great businesses and hold them for as long as they become great businesses.

I learned this lesson the hard way when I was still fairly new to investing in individual stocks. I had bought shares of Tesla (NASDAQ:TSLA) for about $23 shortly after its IPO. Then, when the Model S was named the Motor Trend car of the year in 2013 and shares shot up to $65, I sold because I had "more than doubled my money." About seven years later, Tesla trades for about $1,200 per share. I could have literally bought a fully loaded Model S with the gains I missed out on because I sold a promising business too early.

The bottom line is that there are several good reasons to sell stocks that investors should be familiar with. But simply because a stock's price went up isn't one of them.

Check if rebalancing is needed

One move that you might need to make, especially if you haven't done it in a while, is to rebalance your portfolio. Essentially, rebalancing means adjusting your investment allocation to make sure it's still in line with your objectives.

Consider this simplified example. Let's say your goal is to invest 75% of your money in stocks and 25% in bonds and you have $100,000 so you set up a portfolio that has $75,000 invested in stocks and stock-based funds and the other $25,000 in bond funds.

Now, let's say that the stock market rises by 50% but your bond investments don't change in value. The stock portion of your portfolio is now worth $112,500 and your bond investments are worth $25,000. Stocks now make up about 82% of your portfolio. This is definitely a good problem to have, but such a high stock allocation might not fit your risk tolerance. So, you may want to shift some money from stocks to bonds to bring it back to the 75/25 allocation. If the market rises sharply in July, you might want to check to see if your investment allocation is where you want it to be.

Investing is a marathon, not a sprint

The bottom line is that successful investing is a long-term process, so while it's certainly nice to watch the value of your brokerage account go up, it's important not to lose sight of your big picture strategy. By keeping these three principles in mind, you'll be well equipped to make smart investment decisions even if the market continues to rise.