Investing

question is whether capital gains losses will be reduction of gains if not in the same period that I lived in the previous state.   EG. had gains in first half before leaving California but if I do tax loss harvesting in second part of the year will it not be a reduction of overall capital gains for the state?