To say that the stock market has been interesting in recent months would be a major understatement. New and exciting IPOs are hitting the market with increasing frequency, tech stocks have been soaring higher at breathtaking paces, and some of the largest stocks in the market decided to split their shares.

Over the past month or so, I've made three major moves in my stock portfolio. I bought shares of recent IPO Lemonade (NYSE:LMND) and cloud analytics company Datadog (NASDAQ:DDOG), and decided to sell a large chunk of my Apple (NASDAQ:AAPL) position. Here's why.

Group of people using smartphones.

Image source: Getty Images.

The future of insurance?

One stock that I've been watching since its IPO and recently decided to pull the trigger on is Lemonade, an insurance technology company. Lemonade aims to leverage artificial intelligence (AI) technology to create the most user-friendly, fastest, and most cost-effective insurance buying experience. Lemonade primarily sells renters and homeowners insurance, but plans to expand to other forms in the future.

Perhaps the most interesting quality to me as a long-term investor is that Lemonade is targeting first-time insurance customers, and so far has been very successful. Most Lemonade customers -- 90% -- say they didn't switch from other insurance carriers, and 70% are under 35. Virtually everyone needs or should have renters or homeowners insurance, so the customers Lemonade is bringing into its ecosystem could remain clients for decades to come.

Insurance is a $5 trillion market in the U.S. alone, and Lemonade has a big first-mover advantage. Because Lemonade is a recent IPO and volatile stock, I opened a rather small position, but I may add to it over time.

Taking advantage of the tech pullback

I've had my eye on several tech stocks, but valuation has been an obstacle. Simply put, tech stocks have performed incredibly well over the past few months. However, they've pulled back a bit recently, and I decided to add shares of cloud analytics company Datadog to my portfolio.

If you aren't familiar, Datadog provides a platform for developers and IT departments to analyze data and perform many other functions. My colleague Danny Vena recently wrote a great article on Datadog, if you want to learn more about the company and how it's doing.

In a nutshell, Datadog's growth has been extremely impressive, with 37% year-over-year growth in its customer count and a dollar-based net retention rate of 130%. These qualities essentially mean that Datadog's customers are spending more and more as time passes. While this certainly isn't a cheap stock, the growth speaks for itself, and I'm excited to add it to my portfolio.

A wonderful business, but I had to do some rebalancing

I don't just buy stocks; I sell them from time to time for a variety of reasons. One that I recently decided to get rid of recently was Apple. More specifically, I sold half of my Apple stock, which had been my largest investment by a wide margin.

To be perfectly clear, I sold Apple primarily because it performed so well that it became too large a portion of my portfolio. This is different than selling a stock just because the share price went up. There are several stocks in my portfolio that have increased 1,000% or more since I bought them, such as Square (NYSE:SQ), and I have absolutely no plans to sell them. My personal comfort zone maxes out at about 10% of my investments in any given stock, and Apple's recent run put it well in excess of that limit. Even after selling half of my Apple shares, the tech giant is still my largest investment. It's also worth mentioning that my Apple shares are held in retirement accounts, so I won't have to pay tax on the profit. This fact also impacted my decision.

I'm not losing faith in Apple as a great long-term investment, nor am I taking profits because the stock went up. If either was the case, I would've sold all of it. But it's important to take a step back and decide if rebalancing your portfolio is a good idea every once in a while.

Do your own due diligence

Don't buy or sell any stock just because someone else did. These three moves make good sense for my investment strategy, goals, and risk tolerance, but they might not be a great fit for you. Do your own due diligence before buying or selling any of them.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.