On the heels of two brutish earnings seasons, with a third soon to follow, there's no shortage of bearish sentiment among companies. But figures on insider trading -- the legal sale and purchase of stock by company executives -- show a long-term trend that belies all the hangdog sentiment in evidence lately.

While nobody's suggesting insiders are feeling jolly, trading activity suggests they're gradually getting less bearish.

That's especially true at tech companies, where insiders might be expected to be the most glum. Consider the sell-to-buy ratio calculated by

Thomson Financial/Lancer Analytics

, which plots how many dollars' worth of insider shares are sold for every dollar being bought. A low ratio signals more bullishness, while a high ratio indicates bearishness.

The sell-to-buy ratio for tech companies stands at $37.14 -- surprisingly, about in line with the five-year average of $37.46. Compare that with the numbers back in March 2000, when the ratio hit a high of $97.63 as anxious insiders at tech outfits rushed to sell overpriced holdings.

There are similar signs that sentiment in the broader market is becoming less spooked, even if it's far from confident. "What's interesting is that the ratio of selling to buying has been getting less bearish since the beginning of the year," says Kevin Schwenger, a research analyst at Thomson Financial/Lancer Analytics.

For now, the sell-to-buy ratio for the overall market still looks depressed. At $15.62, the figure remains higher and more bearish than the historic five-year monthly average of $12.12. But the ratio is well below the peak of $26.43 it hit this February.

Meanwhile, the six-month moving average for insider selling has shown a notable downward trend ever since sales peaked at around $20 billion in February/March 2000.

Still, recent insider activity in the broader market hardly reflects any immediate optimism, and sentiment is gloomiest in the tech sector. Between March and April, the most recent information available, insider tech buys (as measured by the dollar value of shares bought) dropped 31%, from $29.3 million to $20.3 million, according to Thomson Financial/Lancer Analytics.

Insider purchases of stock are considered a more important reflection of sentiment than sales because shareholders may sell stock simply as a means to diversify. Insiders buy corporate stock, however, because they think it's a good investment, and a sharp fall in insider buying suggests they don't see much good news on the horizon.

Overall insider buying rose an anemic 2% between March and April to $171.8 million. While that's the highest monthly volume of insider buying since December, it's still well below the historic five-year monthly average of $309.9 million.

"Insiders haven't really jumped in yet, and that has been a big surprise to us," says Jonathan Moreland, research director at

Edgar Online's

InsiderTrader.com. "We see clusters of companies that individually look like tremendous values."

Lately, one sector that's seen relatively active buying activity is oil exploration and aerospace/defense. Thomson/Lancer says it has noticed high levels of insider buying at

Stone Energy

(SGY)

,

Tom Brown

(TMBR)

,

Swift Energy

(SFY) - Get Report

,

Loral Space

(LOR) - Get Report

and

Northrop Grumman

(NOC) - Get Report

.

"It's almost as if insiders are saying we've maybe hit a bottom or are near a bottom, but people don't really feel like the stock market's going to take off right away," says Schwenger. "They don't see any catalyst that will really drive it, even though the market's been doing a little bit of a turnaround lately."

"As far as labeling sentiment, I don't want to say it's bearish. It's almost neutral," he says. For sentiment to qualify as bullish, the level of insider buying would need to intensify, with the volume of selling declining or at least remaining flat.

Relative to other sectors, tech companies have seen a marked increase in insider selling recently, with insiders presumably trying to lock in gains following the

Nasdaq's 37% rise from its April low. Between March and April, insider selling at tech companies was up 61%, from $466.5 million to $753.3 million.

Six of the 10 companies with the most insider selling in April hailed from tech industries, with stocks such as

AOL Time Warner

(AOL)

and

Microsoft

(MSFT) - Get Report

among those that saw the heaviest selling.

But outside of tech, corporate insiders haven't seized on the market's run-up as an opportunity to bail out of holdings in a big way. Last month, overall insider selling increased 17% to $2.7 billion. While that may sound like a decent increase, the actual sales volume is the second lowest since June 1999, and well below the five-year monthly average of $3.5 billion.

Even if insiders are glum about the near-term outlook for their companies -- as reflected in the low level of stock purchases -- they seem to be holding out hope that the stocks will move higher in time, rather than fearing the shares will lose a lot more value. Given the prospects for another evil earnings season, that may be the best investors can hope for.