With stocks in a tailspin, no one would blame you for feeling a little anxious.

After all, there’s a good reason for that. Losses hurt roughly twice as much as equivalent gains feel good, according to research by psychologists Daniel Kahneman and Amos Tversky, who introduced the concept of loss aversion in 1979.

So when the Nasdaq plunges 5%, the Dow Jones Industrial Average falls 3% and the S&P 500 drops nearly 4%, as they have at this writing, the emotional toll can be far greater than the numbers suggest.

In fact, if the research is any guide, it might take the prospect of a 10% gain to offset the psychological pain of a 5% loss. That’s an illustration, of course, not a precise measure of how every investor feels.

And that’s precisely why days like these can be so dangerous for investors. The pain of losing money can overwhelm the discipline required to keep it growing over time.

It’s that discipline I want to address today.

Investing, at least from where I sit, requires having a plan and sticking to it.

If you have a plan, or what advisers often refer to as an investment policy statement, or IPS, revisit it. Your plan will likely tell you what to do during times like these. Whether to rebalance or, more often than not, stay the course.

If, however, you don’t have an IPS, now is as good a time as any to draft one.

There are lots of reasons for doing so. For one, it can help keep emotions from driving your investment decisions.

And two, it will help memorialize what you’re trying to accomplish with your investments and how you intend to accomplish it.

In fact, the CFA Institute, in its guide to investment policy statements for individual investors, makes much the same point. An IPS can provide an objective course of action during periods of market turmoil, when emotional or instinctive reactions might otherwise lead investors to make decisions they’ll later regret.

Put another way, an IPS won’t eliminate loss aversion. But it can help prevent loss aversion from dictating what you do next.

How to create an investment policy statement

I like to recommend two places to start. One is the CFA Institute’s 26-page booklet, Elements of an Investment Policy Statement for Individual Investors. The other is the Fi360 Sample IPS Guide & Template.

There are other useful resources, including Morningstar’s guide to creating an investment policy statement and the Comprehensive Personal IPS Architecture.

Regardless of which one you use, the basic elements are similar. And you don’t have to make this overly complicated. The point is to create a document that reflects your financial circumstances, goals and willingness and ability to take risk.

Put simply, you’ll want to start by identifying your goals and objectives.

Are you trying to accumulate $1 million in your retirement account to fund your desired standard of living in the future? That needs to be written down.

How much risk are you willing to tolerate? Are you prepared to accept declines of 10% or 20% in your portfolio? That needs to be memorialized, too.

Your time horizon must also be in the document. Do you have 12, 20 or 30 years to reach your goals? Or are you already retired and drawing down your savings?

Those are very different circumstances, and your IPS should reflect that.

There’s another number worth putting in your IPS: your expected rate of return.

Expect a rate of return

How much do you reasonably expect your portfolio to earn over time? And perhaps more important, how much do you need it to earn to accomplish your goals?

Those aren’t necessarily the same number.

Let’s say your financial plan requires a 7% annual return to accumulate enough money for retirement. But given your asset allocation and reasonable assumptions about future market returns, you expect to earn just 5%.

Well, you’ve got a problem.

You might need to save more, work longer, spend less in retirement or reconsider how much investment risk you’re willing and able to take.

What you shouldn’t do is simply assume you’ll earn 7% just because your financial plan requires it.

And there’s another wrinkle. Are you talking about returns before or after inflation, taxes and investment fees? Those differences matter, especially when you’re trying to determine how much money you’ll have available to spend in retirement.

To be sure, expected returns are estimates, not guarantees. And your actual returns will vary, sometimes considerably, from year to year.

But having a reasonable long-term return assumption in your IPS gives you another way to judge whether your investment strategy is appropriate for what you’re trying to accomplish.

How much investment risk can you really afford?

There’s another distinction worth making here, one that the CFA Institute addresses in its guide.

There’s a difference between how much risk you’re willing to take and how much risk you can afford to take.

You might have the stomach for a 20% decline in your portfolio. But what if you’re retiring next year and will soon need to start withdrawing money to pay your living expenses?

You might be willing to accept that loss, but are you financially able to absorb it without jeopardizing your retirement?

That’s what advisers mean when they distinguish between risk tolerance and risk capacity.

And both need to be addressed in your IPS.

The same goes for liquidity, or how much cash you need to have available.

If you’re retired, for instance, your IPS might specify how much money you want to keep in cash or short-term investments to cover planned withdrawals without having to sell stocks during a market downturn.

Your IPS should also address how much you expect to withdraw from your portfolio each year, along with the effects of inflation, taxes and investment fees.

After all, the purpose of investing isn’t simply to accumulate the largest possible portfolio. It’s about having enough money to accomplish whatever it is you’re trying to do.

Your asset allocation can help take emotion out of investing

Another requirement is your asset allocation.

Few people, though I know a few, have 100% of their investable assets in equities.

More often than not, people spread their money across a variety of asset classes, including large-, mid- and small-cap stocks, growth and value stocks, government and corporate bonds, real assets and, in some cases, cryptocurrencies.

Your policy statement should address how you’ll divide your money among the assets in your portfolio and, just as important, when you’ll rebalance.

Consider this simple example.

Let’s say you have a portfolio where 60% of your assets are invested in stocks and 40% in bonds.

And you write in your IPS that you’ll rebalance whenever either allocation moves more than, say, 10 percentage points from its target. That’s just an example, not necessarily the right threshold for everyone.

Now let’s say that because of market activity, your portfolio has shifted to 49% stocks and 51% bonds.

What would you do?

Well, your IPS has already answered that question.

You would rebalance back to 60/40 by selling enough bonds to move 11% of your total portfolio’s value into stocks.

In other words, you’d be buying stocks after they’ve fallen in value, something that might be difficult to do if you were relying solely on your emotions.

To be sure, that’s a very simple example.

Rebalancing can have tax consequences, particularly in taxable accounts. And there may be transaction costs to consider as well.

Your IPS should address those issues, too. It might specify whether you’ll use new contributions, dividends or withdrawals to help rebalance before selling investments.

But the larger point remains. You’ve established a rule in advance rather than making an investment decision in the heat of the moment.

Your portfolio may be doing better than the headlines suggest

The 60/40 example illustrates another point worth making.

Let’s assume you’re not investing 100% of your investable assets in stocks. Instead, you have a diversified portfolio with, say, 60% in stocks and 40% in bonds.

If that’s the case, your portfolio may be doing considerably better than the headlines suggest.

Consider the Vanguard Balanced Index Fund (VBIAX), a traditional balanced mutual fund that invests roughly 60% of its assets in the U.S. stock market, tracking the CRSP US Total Market Index, and 40% in investment-grade bonds, tracking the Bloomberg U.S. Aggregate Float Adjusted Index.

At the time I checked, the fund was up 1.09% on Thursday.

Well, guess what? That’s a different picture from the one you might get by watching the Nasdaq plunge 5%.

To be fair, a 60/40 portfolio can lose money, sometimes substantially.

But it does illustrate why you shouldn’t judge the performance of your investments by looking at a single stock market index.

In fact, your IPS should identify the benchmarks you’ll use to measure your portfolio’s performance.

If you’re invested in a diversified portfolio of stocks and bonds, why would you judge your success or failure solely by what happened to the Nasdaq today?

You shouldn’t.

When should you change your investment policy statement?

There’s one more element of an IPS worth discussing.

When should you revisit it?

The CFA Institute recommends establishing a process to review and update an IPS as circumstances change. Its sample language includes an annual review.

That strikes me as a reasonable starting point.

But there are other times when you might need to revisit your plan.

Perhaps you’ve lost your job. Or you’re getting ready to retire. Maybe you’ve experienced a divorce, the death of a spouse or an unexpected expense that changes your financial circumstances.

Those are legitimate reasons to reconsider your investment strategy.

A bad day in the stock market, by itself, probably isn’t.

And there’s an important distinction here between reviewing your IPS and changing it.

You might review your plan during a market downturn and conclude that it’s still appropriate. Or you might discover that the risk you’re taking is greater than you can financially afford.

Either way, the decision should be based on your circumstances and objectives, not simply on what the market did today.

That’s why the CFA Institute emphasizes that an IPS should be tailored to the individual. A template can help you get started, but it can’t account for every investor’s particular circumstances.

The worst time to make an investment decision

So rather than spend tonight listening to pundits debate the latest sell-off in tech stocks, the future of artificial intelligence or where the market is headed next, consider doing something that might prove far more valuable.

Write down your investment plan.

Decide what you’re trying to accomplish, how much risk you’re willing and able to take, how your money should be invested, when you’ll rebalance and under what circumstances you’ll change course.

And then put that plan somewhere you can find it the next time stocks take a nosedive.

Because the worst time to decide what to do with your investments is when you’re frightened about losing money.

And the best time?

Before the market gives you a reason to be frightened.