Hi All,
I want to calculate Annual stock returns by compounding monthly stock returns for a twelve-month period ending four months after the end of the fiscal year of the firm. The information I have includes firm_ticker (firm identifier), dates, and fiscal_year_end.
The sample consists of around 4000 unique firms with information for the period 2004 to 2012. Mostly the firms have fiscal year end of December, March, June, and September. The subsample of the data looks as follows
FIRM_TICKER | DATES | FISCAL_YEAR_END | PRICE |
A | 1/31/2004 | 9 | 8.5 |
A | 2/28/2004 | 9 | 8.25 |
A | 3/31/2004 | 9 | 8.6 |
A | 4/30/2004 | 9 | 9 |
A | 5/31/2004 | 9 | 8.33 |
A | 6/30/2004 | 9 | 8.4 |
A | 7/31/2004 | 9 | 8.6 |
A | 8/31/2004 | 9 | 8.9 |
A | 9/30/2004 | 9 | 8.75 |
A | 10/31/2004 | 9 | 8.8 |
A | 11/30/2004 | 9 | 8.4 |
A | 12/31/2004 | 9 | 8.22 |
| | |
A | 1/31/2005 | 9 | 8.9 |
A | 2/28/2005 | 9 | 8.75 |
A | 3/31/2005 | 9 | 8.8 |
A | 4/30/2005 | 9 | 8.4 |
A | 5/31/2005 | 9 | 8.22 |
A | 6/30/2005 | 9 | 8.4 |
A | 7/31/2005 | 9 | 8.6 |
A | 8/31/2005 | 9 | 7.9 |
A | 9/30/2005 | 9 | 7.8 |
A | 10/31/2005 | 9 | 8 |
A | 11/30/2005 | 9 | 8.2 |
A | 12/31/2005 | 9 | 8.25 |
I would appreciate if someone could share the code for annual return calculation.
Thanks in advance.