The past few months have opened up a world of opportunities for those with cash left to invest. Panic-driven selling has made even experienced traders throw fundamentals out the window, leaving those who have the time to wait and the money to invest with a potential gold mine from cheap shares of great companies.

But for plenty of people, buying more stock isn't an option. Since last year's peaks, there have been lots of dips that seemed like they might be the last, best chance to buy. As a result, many investors have already moved all the cash they have into shares -- often at much higher prices than what you see now.

So if you already have your entire portfolio in stocks -- or if you just can't afford to take more risk in your investments -- what's the right thing to do now?

Two paths you can go by
For many investors, the answer is as simple as this: don't do a thing. If you've already got a mix of stocks and other investments that you're comfortable with and that you believe will perform well in the long run, then you don't need to make changes simply for the sake of doing something. Sit tight, wait out the decline, and keep making your regular investing contributions if you're still in a position to do so.

But other investors may have some potential problems in their portfolios. Perhaps you realized too late that you were heavily concentrated in a particular sector. For instance, if you own a lot of energy stocks like Chevron (NYSE:CVX), Tesoro (NYSE:TSO), and Apache (NYSE:APA), the sharp declines may have erased much or all of your previous gains -- and with oil nearing $60 a barrel, you may be thinking that energy's correction might prove more severe than you initially thought.

On the other hand, you may have ignored other sectors that now look more promising. For instance, as the likelihood of a bad recession looms ever larger, recession-resistant plays like health care stocks have become more attractive. Ordinarily, you might expect to pay premium prices for stocks where you expect to find some shelter from the storm. But just look at how some health care stocks have performed lately:

Stock

1-Year Performance

Pfizer (NYSE:PFE)

(27.7%)

UnitedHealth Group (NYSE:UNH)

(52.8%)

Schering-Plough (NYSE:SGP)

(56.2%)

Mylan Labs (NYSE:MYL)

(58.3%)

Source: Yahoo! Finance.

So rather than paying up for stocks you think have better prospects, you can capitalize on similar bargains. In effect, it's like trading up in a soft housing market: You'll take a loss on the house you own, but you'll also get a great deal on the better home you buy.

Everything's down
You'll see that phenomenon throughout the markets. Because most stocks have taken a hit, moving money between sectors doesn't involve selling low in one area and buying high in another. For the most part, everything's cheap -- from blue chip stocks to small caps, in both domestic and international markets. It's just a matter of picking where you think your money will work hardest for you.

And it's not just about stocks. In the bond market, both municipal and corporate bonds are trading at extraordinarily low prices. Even high-flying commodities and metals are falling to earth. Of course, there are reasons for that -- reasons that may be justified.

So if you're fully invested but think there are better opportunities elsewhere in the market, you're probably right. Reallocating your investments by selling stocks you don't like to buy ones you like better is a great move. Not only will you improve your profits, but you may also get the benefits of taking a tax loss on your sale.

Turning lemons into lemonade
Obviously, it stinks to be out of cash when the market's low. The length and magnitude of this bear market shows how hard it is to time your purchases to cover every contingency. But even if you can't take full advantage of the declines, you can still work to improve the quality of your portfolio -- and position yourself to make the most of a recovery when it comes.

For more on investing in today's markets:

Right now, the key to successful long-term investing is finding the stocks that have real value protecting investors. Each month, you'll find exactly those kinds of stocks at our Motley Fool Inside Value newsletter. See what we think will weather the market's perfect storm free with a 30-day trial.

Fool contributor Dan Caplinger still has some dry powder, but not as much as he did six months ago. He doesn't own shares of the companies mentioned in this article. Pfizer is a Motley Fool Income Investor selection. UnitedHealth Group and Pfizer are Motley Fool Inside Value recommendations. UnitedHealth Group is a Motley Fool Stock Advisor selection. The Fool owns shares of UnitedHealth Group and Pfizer. Try any of our Foolish newsletter services free for 30 days. The Fool's disclosure policy gives you both sides of the story.