holidays in a time series
Posted: Thu Nov 24, 2011 1:59 pm
hey eviews forum!
My problem is the following:
I've got a time series of daily returns of the german stock index for about 40years (regular 5 day week). here an example:
date:..............return:
12/22/1988.....0.003462753060434306
12/23/1988.....0.005256070350794826
12/26/1988.....0
12/27/1988.....0.002643305595927076
12/28/1988.....-0.002584652419474264
12/29/1988.....-0.001357235556623144
12/30/1988.....0
1/02/1989 ......0.004417088025980047
Now i want to create a dummy variable that equals 1 for the trading day directly before and after a holiday! (a holiday is a non-trading day and the return is always 0)
the problem is that in germany some holidays are't always on the same date (e.g. easter) and some are always on the same date (e.g. christmas: 25.12. and 26.12.)
so how can i create this dummy variable?
my idea is: due to that fact that the return of a holiday is always zero and i think there are no other trading days that have a zero return except holidays i would use something like an if condition like: if the return of a trading day equals zero then the trading day before and after that day should be 1 and 0 if it doesn't equals zero.
unfortunately i don't know how to program such a dummy on eviews and maybe there is even a better solution (because it could be possible that the return of a non-holiday equals zero but it is very unlikely)?!
i would be very nice if you could help me!
My problem is the following:
I've got a time series of daily returns of the german stock index for about 40years (regular 5 day week). here an example:
date:..............return:
12/22/1988.....0.003462753060434306
12/23/1988.....0.005256070350794826
12/26/1988.....0
12/27/1988.....0.002643305595927076
12/28/1988.....-0.002584652419474264
12/29/1988.....-0.001357235556623144
12/30/1988.....0
1/02/1989 ......0.004417088025980047
Now i want to create a dummy variable that equals 1 for the trading day directly before and after a holiday! (a holiday is a non-trading day and the return is always 0)
the problem is that in germany some holidays are't always on the same date (e.g. easter) and some are always on the same date (e.g. christmas: 25.12. and 26.12.)
so how can i create this dummy variable?
my idea is: due to that fact that the return of a holiday is always zero and i think there are no other trading days that have a zero return except holidays i would use something like an if condition like: if the return of a trading day equals zero then the trading day before and after that day should be 1 and 0 if it doesn't equals zero.
unfortunately i don't know how to program such a dummy on eviews and maybe there is even a better solution (because it could be possible that the return of a non-holiday equals zero but it is very unlikely)?!
i would be very nice if you could help me!