It often makes sense to "harvest" capital losses from securities transactions to offset capital gains. Any losses that exceed your gains can offset up to $3,000 of ordinary income for the year.
But not all investment losses are deductible. Under the "wash sale rule," a capital loss is disallowed if you acquire substantially identical securities within 30 days of the sale. This rule often trips up unwary investors.
When are securities "substantially identical?" The definition is murky, but stocks and bonds of different companies are not substantially similar. However, buying and selling shares of mutual funds within the same family could trigger the rule.