If you followed the stock market this past week, you know it was a wild ride for investors.

First, the Dow Jones Industrial Average lost nearly 800 points over the course of two days, largely due to fears about an economic slowdown in China. Then the Dow powered back over the next two days, posting a gain of nearly 1,000 points. On Friday, the Dow had dipped only about 12 points for the day, following solid numbers about America’s economic growth as well as some hand-wringing about whether the Federal Reserve will raise interest rates in September.

Avoiding Financial Panic

All in all, it was a tumultuous experience for anyone who buys stocks or mutual funds. But what happens on Wall Street shouldn’t throw you into a financial panic or keep you up at night worrying about your 401(k) and other investments. Here are 5 do’s and don’ts to follow to successfully deal with all stock market volatility; now and in the future.

1. Don’t be your own worst enemy

Even though investors think they act rationally – on the basis of information, or research into a company or industry – when the going gets tough, most people panic.

It’s a bad idea when you let yourself be ruled by emotion: whether that’s fear, greed, or other emotions. Greed kicks in when the market is doing well, and you don’t know how to take profits and run. Fear can overtake you when you see a huge sell-off is occurring.

One way to avoid working against your own financial interests is to work with a trusted financial professional – like a Certified Financial Planner, investment manager or qualified stockbroker. Any of these individuals can help you to avoid acting impulsively when the stock market is zigzagging.

2. Do have a selling strategy

You should know ahead of time the factors that would cause you to sell: for example, is it if a company has a 20% loss — or maybe a 20% gain?

Have a pre-set game plan for limiting losses, as well as locking in gains.

The idea is to know in advance what you will do when your investments move — either to the upside or downside. And then you have to stick to your sell strategy. It’s called having a “sell discipline.” Those with a sell strategy in place fare much better than other investors.

3. Do use stop loss orders to hedge risk

A stop loss order is an electronic trading order that kicks in automatically when a stock falls by a certain pre-determined amount.

So let’s say you buy a stock at $30 a share; you might have a stop loss at $15. That would limit your downside risk to a 50% loss.

The sell order happens automatically, without you having to think about it or decide what to do. Your stop loss orders should be for money invested for short or medium-term purposes. You don’t need to set a stop loss order for long-term investments, like money you’re investing for your retirement 10 or 20-plus years away.

Even if the markets decline dramatically, rest assured knowing that stocks move in cycles. It usually takes only 18 months or less for financial markets to recover after major selloffs.

4. Don’t count on Wall Street recommendations Many studies have shown a huge amount of bias by Wall Street analysts, not to mention that analysts are always overly optimistic about companies & futures. Why the bias? Often times, analysts don’t want to disrupt other areas of their firm’s business. For example, they don’t want to cut off commissions or they don’t want to hurt the firm’s chances of winning corporate investment banking business — in case their company might want to advise a business on an IPO (initial public offering) or provide strategic counsel to a firm considering a merger or acquisition. The net result of all of this is that it translates into enormously rosy forecasts about publicly-traded companies and a hugely disproportionate number of recommendations by analysts. For example, a recent CNBC story pointed out that among 53 analysts following Facebook, only one had a “sell” rating on the company. And it’s not just in the tech space that this occurs. Throughout the 1990s and much of the early 2000s, it was so bad that only 1% to 5% of all Wall Street recommendations were “sell” recommendations. That’s ridiculous. And it goes to show you that you can’t rely on Wall Street analysts to guide you about when to buy, sell and hold your investments.

5. Do ensure that you’re properly diversified When you have adequate diversification in your portfolio, it’s about the right asset allocation, or mix of investments. The individual stocks, bonds or funds you choose aren’t as important, because a diversified portfolio will help you ride out shocks to the markets. Diversification should be done across many areas: by buying different companies, investing in various industries, having investments of different market sizes (i.e. large, middle and small cap investments), investing styles (value vs. growth), as well as geographic diversification (i.e investing in domestic and well as global securities). Again, good diversification acts as a cushion against wild swings in the market. Follow these 5 dos and don’ts and you won’t have to worry about the day-to-day vagaries of the financial markets. You’ll be able to sleep well at night no matter what the markets are doing.

Lynette Khalfani-Cox is a personal finance expert and co-founder of the free financial advice site AsktheMoneyCoach.com. Follow Lynette on Twitter @themoneycoach and Google Plus.