Calculating daily dividend yield

For questions and discussion related to reading in and working with data.
msrahman
Posts: 53
Joined: Wed Oct 31, 2012 2:32 pm

Calculating daily dividend yield

Unread post by msrahman »

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.
Attachments
Dividend_Rats.xls
File to calculate the dividend yield
(251.5 KiB) Downloaded 776 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Calculating daily dividend yield

Unread post by TomDoan »

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?
msrahman
Posts: 53
Joined: Wed Oct 31, 2012 2:32 pm

Re: Calculating daily dividend yield

Unread post by msrahman »

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.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Calculating daily dividend yield

Unread post by TomDoan »

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
Post Reply