Hello,
I do not use the business calender function very often and assume that my question isn't a really hard one. Anyway, I am struggling to shift missing business calender dates to the next business/trading day. I created my business calender using a long time series of daily returns on a stock market index:
If the Deal_Announced date is a non-trading day such as Saturday or Sunday, these will be missing in the business_date variable. However, instead of generating missing values, I would like to shift these days to the next trading day so that the second Obs. "01.12.2013" (Sunday) is shifted to "02.12.2013" (Monday). Is there a way I can achieve this without manually shifting the Deal_Announced date?
Thanks
I do not use the business calender function very often and assume that my question isn't a really hard one. Anyway, I am struggling to shift missing business calender dates to the next business/trading day. I created my business calender using a long time series of daily returns on a stock market index:
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str10 Deal_No int Deal_Announced "2508865020" 19464 "2588919020" 19693 "2431881020" 19183 "2463387020" 19295 "2366354020" 19005 "2808152020" 20635 "2348789020" 18898 "2527238020" 19513 "2363242020" 18948 "2406806020" 19101 "2551522020" 19571 "2683664020" 20004 "2728048020" 20145 "2712356020" 20093 "2336968020" 18854 "2525219020" 19506 "2437828020" 19204 "3145754020" 21067 "3091683020" 20920 "3212518020" 21223 end format %tdDD.NN.CCYY Deal_Announced gen business_date = bofd("sp500", Deal_Announced) format business_date %tbsp500:DD.NN.CCYY generate date_low = string(business_date-1, "%tbsp500:DD.NN.CCYY") generate date_high = string(business_date+1, "%tbsp500:DD.NN.CCYY")
Thanks
Comment