Now suppose I have an NFA broker like IB, and...
* I have an trade with 100 shares long, market price is $80.
* The stock splits 2:1, so now market price is $40, and I am holding 200 shares long.
* My script detects the stock split, by reading large differences between open and close bars.

Can I just alter all trade structs for that asset? Say...
* TradeLots *= 2;
* g->tr->fEntryPrice /= 2;
... etc.

And then suppose this trade is closed, the correct size order will be issued to the broker?

Or is it perhaps more complicated than that because I need to manage phantom trades and pool trades?