its simple grand total of gains-losses if >0 then u pay tax on that, if negative (you are net a loss), then u can write off 3K of the loss and carry the rest forward to the next yr.