I want to select the contract weely which begin at 11/01/2013, such as begin at (varible name datadate) 11/01/2013, expriate at 11/08/2013, and then datadate=11/08/2013, expriation date is 11/16/2013, since 11/16/2013 is holiday, market not opened at that day, so next contract is from 11/15/2013 to 11/22/2013. Finaly, we pick up all the contrcat which datadate expriation 11/01/2013 11/08/2013 11/08/2013 11/16/2013 11/15/2013 11/22/2013 11/22/2013 11/29/2013 I think we can use lag function to do that, but I don't know how to coding it.
... View more