Only one thing always happens in the financial markets: Values fluctuate. Before investing in any market, at any price, in any climate, prudent investors think about how much fluctuation they can handle. In other words, how much can your portfolio go down before you start to lose sleep?

We all have our trigger points. After the stock market began skidding in October 2007, frayed nerves sent investors scrambling for havens they hoped were less risky. Then the market reversed course. Strong gains in much of 2009 left risk-averse investors on the sidelines, watching stock prices climb and wondering when, if ever, they’d have the stomach to invest in stocks again.

The lesson? You can’t invest—or even not invest—without risk. There are no certain wins, even for experts, but you should understand the kinds of risks that affect stocks, bonds and cash, the three main asset classes. How risks and asset classes interact supplies a basis for investment strategies tailored to your risk appetite.

History lesson

Stocks are subject primarily to market risk (the danger that stock prices will fall below their true value) and investment risk (the danger that the firm you’re invested in does poorly). Bonds are loans, most vulnerable to credit risk (the chance of the borrower experiencing default or bankruptcy) and interest-rate risk (the chance that interest rates will go up, pushing bond values down). Cash—or equivalents such as money market accounts or Treasury bills—is most affected by inflation risk (the risk being that inflation will reduce its purchasing power over time).

Bonds are generally more stable than stocks and in any single year may outperform them. Long term, however, bonds have posted lower returns.: From 1926-2009, large-cap stocks returned an average of 9.6%, while bonds, as measured by intermediate-term government bonds, returned 5.4%. Cash delivered the lowest returns over time: only 3.7% since 1926. It’s important to note that over this same 83-year period, inflation averaged 3%. So the real-world value of these returns is actually 3% lower. That makes cash returns, for example, less than one measly percent.

Combining stock, bond and cash investments to balance their different types of risk is the key to managing overall risk in your portfolio. That said, how your investments match up with your appetite for risk is key. So the question becomes, what’s your risk appetite?

Time heals all swoons

Risk appetite—alternatively called risk tolerance or risk aversion—hinges on one overarching question: What is your time horizon? The answer will basically indicate the mix of stocks, bonds and cash best suited to meet your investing needs.

Generally, the longer your time horizon, the more tolerant of market risk you can afford to be. If the stock market hits a bump when you’re in your twenties or thirties, you have decades to recover. If you’re in your fifties or sixties, however, you’ll need your savings too soon to be too tolerant of market risk. On the other hand, if you’re in your twenties or thirties, you can be less tolerant of inflation risk, which can erode the value of your savings over many years; and investors in their fifties or sixties have less to worry about from inflation risk because their time horizon is shorter.

That’s why investing rules of thumb advise you to steadily shift your mix toward bonds and cash as you age. One common rule is to invest in the percentage of stocks that matches your age subtracted from 100. In other words, at age 66, for example, 34% of your portfolio should be invested in stocks (100-66=34). The remaining 66% should be invested in bonds, with a small percentage in cash for liquidity.

While it’s a good idea to lower risk as you get older, remember that your assets must last through your retirement, not just until you retire. And your retirement could last 30 years or more. So always keep a portion of your portfolio in stocks.

Whether you crave risk or flee from it, sound long-term investing requires a balanced and diversified asset mix. That’s how informed investors strive for financial security and sleep well in any market climate. You can, too.