Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Split rules?

Some points that I did not understand after reading past threads on splits:

I have 140 shares of some stock. When there is a split of 3:2, context.portfolio.positions[stock].amount tells me that I now have 209 shares. Why not 210?
When I start with 14 shares, after the split I have 20. Why not 21?

Do I lose money then because of the split?

What are the rules for calculating the new amount?

And how to deal with cases where the new amount (after the split) even by simply applying the split ratio, does not give an integer. For example, in the split I mentioned above, if I start with 1 share, I should end up with 1.5 shares, which is not possible.

The split happens after I already bought the shares and paid the commission. After the split, will the commission on buying the shares grow retroactively, as if I bought them after the split?
I was reading this thread:
https://www.quantopian.com/posts/should-prices-really-be-split-adjusted-aka-commission-bug
...and it's not clear to me what actually happens to the commission on buying the shares, if there is a split.

P.S. Quantopian, your help page says that Order.commission is an integer. It's actually a float. And commission should not be capitalized.