Hello XXXXXXXXXXX,
There is something known as the "wash sale" rule where you cannot sell a stock at a LOSS and then turn around and buy that same stock again within 30 days, and still claim the loss on your sale.
However, this rule only applies to stocks that you sell at a loss. If you sold a stock at a gain, then you may repurchase that stock at any time. The gain you had from the sale will be reported on your federal tax return, and any carry forward losses you had from prior years can be used to offset that gain.
Your net adjusted gross income from your federal return then transfers over to your California state return, and your gains or losses are already reflected in that amount for state tax purposes.
If this was helpful please press the Accept button. Positive feedback is also appreciated.
Thank you XXXXXXXXXXX
Accountant
25+ years tax consulting. Specializing in returns for US citizens living abroad