Calculating daily dividend yield
Calculating daily dividend yield
Hello,
I want to calculated the daily dividend yield in the following way:
The dividend yield in day t is computed by summing the daily dividends for the week preceding day t and dividing by the value of the portfolio at t.
I have attached the xls file here. Any help would be appreciated.
Sincerely,
Sajjadur.
I want to calculated the daily dividend yield in the following way:
The dividend yield in day t is computed by summing the daily dividends for the week preceding day t and dividing by the value of the portfolio at t.
I have attached the xls file here. Any help would be appreciated.
Sincerely,
Sajjadur.
- Attachments
-
- Dividend_Rats.xls
- File to calculate the dividend yield
- (251.5 KiB) Downloaded 777 times
Re: Calculating daily dividend yield
You need to be a bit more precise about what you want. What happens when you have a week with fewer than five days? Also, are you looking at a value for each day, or just one per calendar week?
Re: Calculating daily dividend yield
Thanks for your reply.
If there is a week fewer than five days, I would like to drop that week.
I am looking for the value for each day.
Sincerely,
Sajjadur.
If there is a week fewer than five days, I would like to drop that week.
I am looking for the value for each day.
Sincerely,
Sajjadur.
Re: Calculating daily dividend yield
This sounds like it will do what you want. Note that this will have quite a few five day gaps in the output series since any missing date in dividends will knock out five days of the weekly average.
OPEN DATA "C:\temp\Dividend_Rats.xls"
CALENDAR(D) 2007:1:3
DATA(FORMAT=XLS,ORG=COLUMNS) 2007:01:03 2019:12:31 VALUE<<"Value of the Portfolio" Dividend
FILTER(TYPE=LAGGING,WIDTH=5) DIVIDEND / WEEKLYAVG
set yield = 5*weeklyavg/value
OPEN DATA "C:\temp\Dividend_Rats.xls"
CALENDAR(D) 2007:1:3
DATA(FORMAT=XLS,ORG=COLUMNS) 2007:01:03 2019:12:31 VALUE<<"Value of the Portfolio" Dividend
FILTER(TYPE=LAGGING,WIDTH=5) DIVIDEND / WEEKLYAVG
set yield = 5*weeklyavg/value