I think this may actually be a semi-workable idea (and legal) and it's not so much a tax evasion scheme as a tax minimizing scheme. But it's probably not worth it unless you're making a very high income from trading.
At most, it only accomplishes for you getting around the limitation you say Brazil has on offsetting losses/gains on foreign derived investment income. Basically, by obscuring from Brazil how you're really earning the money. You're still gonna be paying all kinds of taxes on that income (US and Brazil) and have a buttload of hassle and cost getting it all set up and maintaining the arrangement. Also, better make sure this is even legal in Brazil. And even though what you're talking about can be done legally in the US, you're gonna be audit bait for sure. Better figure in some costs for getting someone to defend you on that.
To do this, as a non-resident alien you'd have to form either an LLC or a C Corp (or an LLC that has your C Corp as a partner). You probably want an offshore LLC (how long are those going to last? who knows). You'd end up paying someone thousands of dollars most likely to set this up for you and to be your agent in the state where you choose to set it up since you don't actually intend to be here. That's a requirement. By the way, now you have to track how much time if any you spend in the US vs. outside. Also, now you're subject to complicated US rules on how to handle your trading losses and gains. Let's hope you're not also employed in Brazil cause that's a whole other can of worms.
OK, so assuming it's still worth it to you, the next problem you have is determining whether your income is derived from the US or not. I'm not 100% sure but I'll bet that you find it is if you're trading US equities or derivatives on US exchanges. Don't know about currency. This is important because it determines whether or not you will be taxed on the income you earn here - just being a non-resident doesn't automatically get you out of US federal income tax by the way.
Let's assume the worst case that the income is considered to be US derived income. Then if you go the C Corp route, you will be paying corporate taxes and you will owe US taxes on your salary you pay yourself and any remainder that you might owe to Brazil after deducting what you paid in the US.
If you go the LLC route, then again you are likely going to end up paying US income tax and then also whatever else you may owe Brazil after offsetting the US income tax.
Should you be lucky enough that someone can figure a way your income is not considered US derived (I doubt it), then you don't pay the US federal income tax (except corporate taxes if you go with a C corp). But you obviously still owe Brazil income tax on the full amount now.
Now, if it's true what another poster said about the feds wanting to limit this kind of thing and cracking down on the states that make this easy (Nevada, Delaware and Oregon to my knowledge), then you will have gone to a lot of expense and bother for something that may not last long.
However you really do need a GOOD accountant and lawyer as mentioned above because there's all kinds of obscure laws and gotchas such as when the controlling member of a corporation is a non-resident alien and hires himself. Stay away from the cheapie internet sites that offer to form a business entity for you and find someone you know is reputable.
So what have you accomplished? You've found a way that you can offset losses/gains legally (at least in the US - don't have a clue about Brazil), but you'd really have to think about whether the cost and hassle of doing this is worth what you will save in Brazilian taxes. I doubt it would be.
Good luck figuring out the costs/benefits of this one! You'll be paying thousands US$ a year to a lawyer, accountant and agent to keep this all running. And by the way, I only half know what I'm talking about because I'm not a professional in this field so don't rely on my interpretation for anything more than another viewpoint on your post.
Another thought is to trade Brazilian markets or look into currencies to see if they're handled differently in your county. Or -here's a crazy idea - pay what you owe Brazil and bug your politicians to spend your money wisely.
FC