On a day like yesterday, everything seemed perfect. As long as you had your money invested in something, you probably saw it go up. Stocks soared, as the Dow and S&P 500 set new two-year highs. Seeing a sea of green on your portfolio screen is always a nice feeling. You might even conclude from a day of great returns that the Federal Reserve's latest round of quantitative easing is already a huge success.

But as happy as they make investors, skyrocketing asset prices come with costs -- both short-term and long-term ones. If you're not careful, you'll end up paying in two different yet equally painful ways.

The immediate cost
Booming markets make investors happy. But for the things you have to buy, rising prices are not your friend. That may not be such a big problem with headline-making movers like gold, but with some commodities, you definitely feel the pinch.

The most obvious example is oil. The price of crude oil, gasoline, and heating oil all hit six-month highs yesterday, as oil prices jumped above $85 per barrel. That's great news for Chevron, ConocoPhillips (NYSE: COP), and BP (NYSE: BP), all of which did even better than the broad market yesterday.

But for consumers, higher oil company profits mean less money in your pocket. You may not have noticed much pump pain yet, since gasoline prices tend to drop off in the fall as demand from summer travel goes away. But if you use heating oil to heat your home, then the recent $0.40 spike translates to hundreds of extra dollars over the course of the coming heating season.

Companies have also started passing on price increases for other products. Kraft Foods (NYSE: KFT) and Starbucks (Nasdaq: SBUX) hiked coffee prices earlier this year, which rose to new highs for the year yesterday. Jones Apparel Group (NYSE: JNY) and Hanesbrands (NYSE: HBI) are planning to raise prices on their products to offset higher costs of cotton. Even McDonald's (NYSE: MCD) is looking at raising menu prices next year in order to offset higher costs of meat and sugar.

Trends toward higher prices among commodities were already firmly in place before the Fed acted. But based on yesterday's price action, it's clear that the Fed's move has renewed the push toward rising commodity prices.

The longer-term cost
Those immediate costs may seem trivial compared to rising portfolio values. But QE2 may also have a much more long-lasting impact that hurts investors in the long run.

Rising markets always look good as long as they keep going up. During the tech stock bubble, people came up with innovative new ways to justify valuations on companies with neither earnings nor sales. Similarly, when housing prices were approaching their peak, people made home-buying decisions as if prices would keep rising forever.

It's only after prices reverse that people look closely at whether those gains were real or artificial. In this case, the Fed's move is clearly artificial; if the system were working naturally, then QE2 wouldn't have been necessary.

Gains like yesterday's have a huge psychological impact. They scare investors off the sidelines by showing them the big profits they'll miss if they don't put their money to work. Yet by buying after the big price run-up, they're then at the most risk of suffering future losses -- ones that could convince them once and for all that the stock market is a rigged game.

Stop the madness
Government intervention in the investment arena seems to be increasingly commonplace. Although some will argue that such measures are necessary to ensure economic growth, the institutional damage it does to investing erodes confidence in the very system they're meant to protect. In the end, you'll pay the price for QE2, and unless you're very careful, it could end up taking back all of yesterday's gains and more.

Some stocks will do well no matter what the Fed does. Click here to get The Motley Fool's free report, 5 Stocks the Motley Fool Owns ... and You Should, Too.