On Wall Street, optimism is easy to spot.

When a stock that has been struggling for a long time starts showing sustained gains, it's a pretty sure sign that investors have become optimistic about the company's prospects.

And when a stock goes up just before the company issues its quarterly financial report, there's no better indicator of optimism in the market.

There's also no worse time for anything to go wrong. Nothing will make a stock drop faster than building up investors' expectations, then pulling the rug out from under them.

Today's the day when the optimists will find out whether they're right about Manugistics Group Inc., the Rockville maker of software that's used by big corporations to manage their inventories.

This afternoon, after the stock market ends its regular session, Manugistics will report results for the third quarter of its fiscal year. Analysts are looking for a 30 percent to 40 percent increase in quarterly revenue and crossing their fingers in hope that Manugistics will do even better than that.

That optimism has boosted the price of Manugistics stock by 50 percent over the past three weeks, and doubled it over the past two months. The shares trade on the Nasdaq Stock Market under the symbol MANU.

At yesterday's closing price of $22.93 3/4--down 50 cents over the past couple of days--Manugistics stock is the highest it has been since the summer of 1998.

Similar optimism gave Manugistics stock a brief bump just before its June quarterly report, but the numbers were not good enough to sustain the gains. Even after that disappointment, Manugistics-watchers think this time, the company will deliver.

"From what we hear in the marketplace, they are likely to hit their numbers. But more important what we're hearing is that their backlog and their pipeline is really building," said analyst Christopher Desautelle of Legg Mason Wood Walker in Baltimore.

Desautelle, who recommended the stock back when it was in the $11 range, has patiently waited for the company to recover from the streak of disappointing earnings that drove its stock from $64 a share to about $6.40 last year. The slide forced founder William J. Gibson to bump himself upstairs to chairman, and bring in an outsider as chief executive and chief turnaround artist.

The new Manugistics president, Gregory J. Owens, is one of the reasons investors are feeling better about the company, said Rick Ruvkun, a senior vice president and portfolio manager for

J. & W. Seligman & Co., a New York investment firm that is a big holder of Manugistics stock.

"We're optimistic about this management's ability to execute," Ruvkun said. Though Manugistics software for managing the ordering, delivery and stockpiling of parts and raw materials used in manufacturing plants is highly regarded, the company's sales and marketing effort has been weak.

Ruvkun and Desautelle both point out that Manugistics is a solid number two in the business of "supply-chain management software" and has held onto that status during its two-year slump.

The market leader is I2 Technologies Inc. a Texas firm whose stock has exploded while Manugistics' shares have languished. From $20.50 a share last April, I2's stock rose to a record $165 last week and closed yesterday at $147.87 1/2.

Though I2's latest quarterly revenue of $146 million is about four times as much as Manugistics is expected to report today, the market value of its stock is now 18 times that of Manugistics.

That huge difference in valuations is considered a sign of the upside potential in Manugistics stock, analysts said.

Another plus for Manugistics and the whole industry of custom business software is the upcoming showdown over the Y2K software issue. Companies have been so worried about adapting their computers to handle the date change that they've cut back other software spending. With that cost behind them, corporations now will be catching up on other software needs, the theory goes.