Thank you for the clarification on your question.
There is really no difference between the states as to what is considered state sourced income. You are considered to have income from a state if you physically work in that state and earn income, or if you have a business which is located in that state. You would also have CA source income if you sold property that was located in that state.
If you sold shares of stock of a company that you owned which was located in CA, you would have CA source income. However, general sales of stocks that are traded on the stock market would not be taxable to you in CA, regardless of which stock it was that you sold. For instance, if you owned stock of Chevron Corporation which is headquartered in California, you would not owe CA taxes on the sale of that stock just because the company is headquartered in that state.
When you sell stocks that are listed on one of the stock exchanges, you are only responsible for taxes to the state where you are a resident. Since you were not a resident of any state in 2007, your only tax liability on those sales would be to the IRS and not to CA or to any other state.
Without seeing the tax program that you are using, I cannot explain why it would be adding these to your California income, as these sales would not be taxable in the state of CA, or in your case, to any state. You will only owe federal tax on any gain you had from these sales.
If this was helpful please press the Accept button.