I am new to quantopian and recommended by my friend, after writing a very simple buy and hold strategy on a single stock APPLE. I found a very strange problem for the dividend calculation.
OK, here's the strategy attached, spent all the cash 100,000 to buy AAPL at 2014/03/01 and hold it to 2014/09/01, simple enough.
During this period there's a ONLY ONE split happened at 2014/06/09: 1 to 7.
And two dividends event:
1. 2014-05-16: 0.47
2. 2014-08-15: 0.47
OK, now let's look at the calculation result in Daily Positions & Gains, notice that the only contribution could happen to my cash change is DIVIDEND
1. At the very beginning I've bought 1326 shares of AAPL. Cash is -673.9. I understood that quantopian is using SPLIT adjusted price for smooth backtesting, so the shares cal is correct.
2. At 2014-05-16, I've got the dividend cash contributed into my Cash: 3688.64, which means dividend cash at 2014-05-16 is: 4361 This looks strange, since a quick calculation 0.47 * 1326(shares) = 623
3. At 2014-08-15, I've got the second dividend cash and contributed into my Cash: 4311.86, so the dividend distributed at 2014-08-15 is 623.2. If we do a quick calculation, 0.47 * 1326 = 623, so the dividend this time makes sense considering split already happened.
But now things are very wrong: dividend cash before split is larger than dividend cash after split, it's around 7 times larger - which is the same split number.
Conclusion is: it seems that dividend calculation before a split event is doing "*" split factor instead of "/" split factor.