As a visitor, your residence does not change due to the temporary absence from your resident country.
Your filing requirement as a nonresident alien does not change. If you previously had to file for income that is effectively connected to the United States you still have to file fro that income. If you had no prior filing requirement, that does not change by virtue of visiting the United States.
For more details see Taxation of Nonresident Aliens
I hope this helps clarify that visiting does not change investments subject to US income tax.
Enjoy your visit!