For investors, August is the cruelest month. Forbes magazine publishes its annual survey of mutual-fund performance, showing which funds you should have bought, had you only been clever enough to know. It also suggests which type of funds might be best for the future--if only Forbes is clever enough to guess.

Thousands of small investors have been coming back to traditional mutual funds--investment companies that buy stocks and bonds. In the 1970s, fund investors sold more shares than they bought. But for the first six months of 1983, net sales reached a record $15.1 million.

Stocks have performed so well over the past year that almost every stock-oriented mutual fund has a proud tale to tell. While the Standard and Poor's 500-stock average was rising 53.4 percent from the recession bottom, Forbes' index of stock mutual funds leaped 63.3 percent.

Forty-one stock funds out of a total of 341 rose more than 100 percent. If you're picking a fund, you might naturally look for the one with the best recent record.

But any dummy can make money when the whole market is rushing up. The trick is to hold on to those gains over the long term.

Market analysts believe that the bull market in stocks will exert itself again by 1984, but between now and then is anyone's guess. If stocks fall a bit, the high-flying funds will decline more than average; they will then need higher-than-average gains just to make up the ground they lost.

By contrast, a mutual fund that does well in declining markets can preserve your capital and perhaps give higher returns over the long run. When faced with a sloppy market, it's useful to find out which funds know how to invest defensively.

That's where the annual Forbes survey comes in (on newsstands now; the Aug. 29 issue). Like any performance survey, it shows you what's hot and what's not. But more importantly, it rates mutual funds according to how well they perform in both rising and falling markets. Ratings run from A-plus to F, just like report cards. A fund makes the honor roll if it rates a B performance or better in both rising and falling markets.

On average, this year's 27 honor-roll funds returned 17.4 percent a year over the past decade. That compares with 15.1 percent for a group of funds with top records over the past 12 months--showing that one-year top performances aren't the best measure of success. Forbes' total stock-fund composite returned only 10.8 percent a year.

Only three funds get A ratings for performance in both bull and bear markets: ASA Limited (a closed-end gold fund, whose shares are traded over-the-counter; you buy through a stock broker for the normal stock commission); and two load funds, bought through brokers for a "load" or sales fee: International Investors (fee up to 8.5 percent) and Research Capital (up to 7.25 percent).

Eight funds yielded more than 20 percent a year for the past decade: Load funds--American General Comstock, International Investors, Over-the-counter Securities, the low-load (3 percent commission) Fidelity Magellan, and ASA Limited. No-load funds--Mutual Shares, which specializes in mergers, corporate turnarounds and bankrupts, and Twentieth Century Select.

The load fund Templeton Growth is a 10-year veteran of the honor roll. Other old-timers among load funds: AMCAP (five years), ASA limited (five years), International Investors and Vance Sanders Special (both four years). Among no-load funds: Mutual Shares (eight years), Twentieth Century Select (six years).

Investors today like to buy into families of no-load mutual funds, which let you switch your money from one fund to another with just a telephone call. Forbes rated all the stock funds of 25 family groups, load and no-load, and found that none gives top performance in both good markets and bad. The lesson here is to pick a fund for its own performance characteristics, not because you can switch in or out of it easily. And the best performance comes from the few funds that know how to cut their losses, as well as let their profits run.