Last week marked the worst week for stocks this year and brought to the forefront the worries in Europe that investors have been sweeping under the rug for months. It's not that Wall Street didn't see the potential for a pullback coming, but it nonetheless caught many traders off guard.

The good news is that not everything went down. That isn't to say the daily list of new highs grew by any means -- in fact, it's about as small a figure as I can recall in recent memory -- but it does signify that there are stocks moving higher despite the widespread carnage.

Today, I want to highlight four stocks either hitting new 52-week highs or within pennies of new highs and demonstrate what characteristics these companies share that make them good investments in times of market weakness. I believe recognizing what makes these stocks successful could help identify other companies that also share these traits.

Here are the winners:

  • Wal-Mart (NYSE: WMT)
  • Verizon (NYSE: VZ)
  • AZZ (NYSE: AZZ)
  • Duke Energy (NYSE: DUK)

Now we'll look at three characteristics these businesses share that makes them successful even in a down market.

High barriers to entry
One often-overlooked, but extremely important, aspect of operating a business involves how easy it is for competitors to open up shop on your turf. For all four of these companies, it's no easy task.

Wal-Mart can use its unbelievable pricing power to undercut nearly all local competitors, while Verizon, AT&T, Sprint, and T-Mobile hold practically the entire U.S. mobile market share in their hands. That's precisely the reason pay-as-you-go providers Leap Wireless and MetroPCS Communications (NYSE: PCS) have struggled in recent years.

As for Duke Energy, which is a utility provider, and AZZ, which manufactures products for utility companies, the cost to enter these businesses is extremely high. A high barrier to entry creates a level of comfort among investors and guarantees somewhat steady cash flow.

Necessity products
Having a product that will be in demand regardless of economic conditions is just as important to these businesses as is having high barriers to entry. In all four cases, these companies provide a product or service that will remain largely unaffected by a falling stock market.

In the case of Wal-Mart, people still need to eat and buy personal goods for themselves, regardless of the economy. With consumers still reluctant to spend much, it continues to be a primary stop for cash-strapped shoppers. Verizon offers mobile, landline, and broadband services that offer little price elasticity. In short, people will pay for these services no matter the state of the economy. AZZ helps in the process of energy generation, while Duke Energy actually powers some of America's households.

Food, personal goods, phone service and energy generation -- consumer staples are a fantastic safety net in times of weakness.

Strong dividend
In times of market weakness, investors often flock to companies that pay out handsome dividend yields. Yes, the allure is the yield, but often the underlying draw of those stocks is the strong cash flow that fuels that yield. These four stocks also perfectly fit this criterion.

Wal-Mart has raised its dividend for 38 consecutive years and produced $10.7 billion in free cash flow in fiscal 2012. Verizon has had only seven consecutive annual dividend increases, but with a nearly 5% yield and having produced $13.5 billion in free cash flow in fiscal 2011, few shareholders are complaining. Duke Energy has also raised its dividend for seven years running and currently yields 4.7%. Finally, AZZ, albeit considerably smaller than its peers, pays out nearly 2% thanks to continuously strong cash flow.

Investigate the market
Having these three characteristics isn't a foolproof success formula, but it's a great start when looking for compelling buys in a weak market. Use the clues that the market is giving you and search for other companies that share these traits, and you may just have found the next stock that'll buck the market trend and hit a new high.

Do you own a stock that meets these criteria? Share it in the comments section below with your fellow Fools.

If you'd like a head start on three companies our analysts feel could help you retire safely, then simply click here for your copy of our latest special report. It's free, but only for a limited time.