If you make a $100,000 loss on an investment and the next year make a $100,000 profit on a (different) investment you can point to the loss and point out that overall you have made no profit and therefore are liable for no tax. Obviously each loss can only be used once.