Hi,
I would like to create a business calendar in a way that Stata creates lead/lag price/returns. In particular, I would like Stata to price/returns on Friday to be considered the previous price/return of Monday. Same for price/returns when there is a day off in the middle of the week. I have checked several Statalist posts & doc about "bcal create" but could not figure out the solution to my problem. Here are exemples of posts I have read:
http://www.stata.com/features/overvi...ess-calendars/
https://www.statalist.org/forums/for...xt-trading-day
Here is what I have so far. The 2 lag "close" price created are the same and do not address the problem:
I would like to create a business calendar in a way that Stata creates lead/lag price/returns. In particular, I would like Stata to price/returns on Friday to be considered the previous price/return of Monday. Same for price/returns when there is a day off in the middle of the week. I have checked several Statalist posts & doc about "bcal create" but could not figure out the solution to my problem. Here are exemples of posts I have read:
http://www.stata.com/features/overvi...ess-calendars/
https://www.statalist.org/forums/for...xt-trading-day
Here is what I have so far. The 2 lag "close" price created are the same and do not address the problem:
Code:
sysuse sp500.dta , clear * Generate wrong lagged price: tsset date gen L_close_w = L.close * Now creat the right lagged price bcal create sp500, from(date) gen L_close_r = L.close * Compare both of them (same at the moment): browse date L_close_w L_close_r
Comment