Hello Everyone,
I have daily stock returns data of 370 companies from the period 2000 to 2014. The data is in long form that contains firm ID, date and its respective return. I want to create 1 year momentum porfolio. For that, I want to calculate cumulative total return for the last one year excluding the last month (month t-12 to t-2) for each stock.
I have collapsed the daily stock returns to months using the code
I am stuck at calculating comulative returns of 11 months exculding the last month
Kindly suggest the code to compute the comulative returns and also let me know is a way to directly compute comulative returns through daily stock returns?
Thank you
I have daily stock returns data of 370 companies from the period 2000 to 2014. The data is in long form that contains firm ID, date and its respective return. I want to create 1 year momentum porfolio. For that, I want to calculate cumulative total return for the last one year excluding the last month (month t-12 to t-2) for each stock.
I have collapsed the daily stock returns to months using the code
Code:
gen m_date = mofd(date) format m_date %tm collapse (sum) return, by( ID m_date year date)
Kindly suggest the code to compute the comulative returns and also let me know is a way to directly compute comulative returns through daily stock returns?
Thank you
Comment