According to CA Publication 1032, page 5, if you are considered a nonresident for California purposes, you are not taxed on income from intangibles, which would include stocks unless they were from California sources.
For military personnel domiciled in California but Stationed Outside Califo
rnia – California military
servicemembers who leave California under PCS
orders become nonresidents of California for income
tax purposes. All income received or earned prior to
departure is subject to tax by California. After departure,
only income from California sources is subject to tax
by California. Nonresidents are generally not taxed by
California on income from intangibles, such as dividends
from stocks or interest from bonds or bank accounts
.
https://www.ftb.ca.gov/forms/2018/18_1032.pdf#page=9