I have a question if dividens are teken into total quity when standard backtest portfolio shows the result.
Buy 1 share AAPL at close price 150.96, next day we have dividend 0.22 and close price is 151.28.
Backtest portfolio shows cumilative profit 0.32 excluding 0.22 of the dividend.
Why is that? How to count it?
(dividend data uploaded to Amibroker by Amiqute)
If you want to follow @mradtke advice - you don't need to do anything. Prices including those coming from Yahoo are usually adjusted for dividends. If you are using different provider, check if you get adjusted prices.
I use Yahoo and the thing is that adjusted prices are coming subtracted dividends from regular Close price. I dont understand why is that. I would get those dividend to my account as addition to regular Close and not subtracted. Where im wrong here?
When a dividend is paid, all prices before the dividend date are adjusted downward by the dividend amount as a percentage of the closing price. In this way, the current prices always reflect actual "as traded" prices, while older prices do not. But in terms of your example, it means that in a backtest you would be entering the AAPL trade at a price of $150.96 - 0.22 = $150.74 [note simplified math here -- the $0.22 would actually be a percentage not a fixed dollar amount]. If you then exit the next day at $151.28, then your profit is $0.54, which correctly reflects the $0.22 dividend plus the $0.32 price change.