I don't mean to be unkind, but you are asking for a generalisation when you really need to deal with specifics.
As has been explained above, the primary consideration is whether you are deemed resident for tax purposes.
Next, is trading income deemed tax exempt as capital gains, which it is in some jurisdictions.
Next, if it is deemed taxable income, then is it deemed local earned income because you made the effort to earn it locally. If so, as a non-resident, you get whacked a flat 30% in some jurisdictions.
Last, and by no means finally, what is construed as work in whatever place you are in? I live in Thailand. I cannot volunteer my time, teaching English, or caring for dogs in a shelter, even without pay, because it is deemed as work for which I need a work permit.
It is a huge grey area. You could claim it's not work, you are simply managing your investments.
When your passport is taken away and you are told to prove your case in a local court before you can leave, the best free advice you can get here on ET is not going to be any comfort to you.