Firstly, I tried to find the answer to this by reading other questions, but I am still not sure and hence this question.
I read that in the United States, I can deduct up to $3,000 in tax losses. So suppose I invest some amount higher than $3000, say $10000 in company A and $10000 in company B. Now in 5 months company A stock prices goes to a few cents, and company B stock price double. If I sell at that point, I have lost $10000 on company A trade, whereas I have gained $10000 on company B trade.
So in this case, is the $3000 limit used against the total effective gain (which is $0), or is it that whatever I gained with company B stock, $3000 is tax-free and I have to pay tax on the remaining $7000?