It's easy to get caught up in the heat -- or chill -- of the moment. Sometimes everybody loves a particular stock. Then, suddenly, everybody hates it. Those situations can present opportunities -- when nothing has really changed about the long-term view, but there's an utter sea change in attitude.

It occurred to me the other day that for the past year or so, Stock Advisor recommendation Amazon.com (NASDAQ:AMZN) has been a perfect example of such a situation. I've been marveling at its recent performance, which I've been tracking on and off in our Motley Fool CAPS community intelligence database. Amazon may be a one-star stock, but right now, that stock appears to do no wrong in the eyes of the marketplace. However, shake off the short term and dig deeper in your memory, and you'll recall this hasn't been the case for Amazon.com over the last year or so. For example, last August I presented the bull case in a Dueling Fools feature on Amazon.com -- and I lost. Times sure have changed.

Summer of hate
Given Amazon's recent stock performance, you could call this summer the summer of love for the online retailer. Over the past 12 months, its share price has increased 78%. That's beating the pants off the retail industry; according to Dow Jones, the broadline Retail Index has only grown about 9% over the same period. Of course, many of us think it's silly to consider Amazon a run-of-the-mill retailer; it's an e-commerce giant, using the strengths of the Internet to its advantage and delving into more and more areas all the time. At the moment, it's certainly hotter than eBay (NASDAQ:EBAY), which is largely considered a respected Internet giant but has its own negative investor psychology to contend with, since its shares have only grown about 10% over the last year.

Last year, though, it was a very different story for Amazon; its current price is up 170% from the 52-week low of $25.76 set last summer. Remember when investors were wholly unimpressed with Amazon Prime, since offering cut-rate shipping for a flat fee beats up margins? Amazon was also on a tear shelling out capital expenditures, and while capex often builds for the long term (it would spell disaster for such a technologically reliant company to fall behind), the market didn't like how that looked for quarterly profits. Investors also looked askance at new shopping areas, such as the bulk groceries, just as they had traditionally balked at any new product area the company came up with. (It's funny to think that over the years, investors seem to get upset about the same things about Amazon, over and over and over, and in the long run, Amazon always seems to do fine.)

There were plenty of points last year when most investors seemed to think Amazon.com was a real stinker, although much of that sentiment could be seen as decidedly short term (and obviously, with a short memory). Now Amazon is on fire, illustrating that once it ratcheted back capex, strong sales growth yielded heartening profits.

Love's labor lost
Last summer, before the market fell in love with Amazon all over again, I defended the company and the stock. Amazon's a smart company run by a smart founder, and the fact that investors seem to cyclically chill to the company -- although most of its actions have yielded competitive advantage over the long run -- seemed downright silly. (Still, there's always that nagging feeling that maybe this time it'll be different that seems to hit investors when times get tough.)

On the other hand, at present, as much as I think Amazon's a great company (and one that's always in the back of my mind as a stock I'd possibly like to put back in my portfolio one day, since I used to own shares back in the '90s), what looks a bit like unfettered optimism right now sure gives me pause.

Have you peeked at Amazon's price-to-earnings (P/E) ratio here lately? It's trading at 118 times trailing earnings, and a whopping 53 times forward earnings. And sure, it is expected to grow earnings by 117% this year, but bear in mind that it won't see the levels of earnings per share it reported in 2004 until next year. It's got a PEG ratio of 2.74 -- compare that to Google's (NASDAQ:GOOG) PEG ratio of 0.94, or even Apple's (NASDAQ:AAPL) 1.50.  

Maybe the lesson from the last 12 months -- or the last couple years, given the fact that some of the same issues seem to haunt Amazon over and over -- is that for those interested in growth and value, it's better to wait for the moments that come along once in a blue moon, when the hate hangs heavy in the air (as long as you're convinced it's just short-term pessimism). Love may make the world go 'round, but in investing, hate usually brings the bargains.

Take a trip down memory lane with Amazon and the Fool:

Amazon.com and eBay are Motley Fool Stock Advisor recommendations. To find out what other companies David and Tom Gardner have recommended to subscribers, take a 30-day test-drive.

Alyce Lomax does not own shares of any of the companies mentioned. There's lots to love about the Fool's disclosure policy.