A friendly reminder that as of 8:30am CST on Thursday December 12th all Equity Index futures will rollover to March 2003 as front month (month/year code is H3).
Alex
Alex
'function to assign an expiry string if one is missing [optional] 'for index futures that subscribe to the second Thursday rule. Public Function fxExpiry() As String Dim StartDate As Date Dim StartDateDay As VbDayOfWeek Dim RollDate As Date Dim strYear As String Dim strMonth As String Dim arrMonth(1 To 4) arrMonth(1) = "H": arrMonth(2) = "M" arrMonth(3) = "U": arrMonth(4) = "Z" Select Case DatePart("q", Date) Case 1: StartDate = "3/1/" & Year(Now) Case 2: StartDate = "6/1/" & Year(Now) Case 3: StartDate = "9/1/" & Year(Now) Case 4: StartDate = "12/1/" & Year(Now) End Select StartDateDay = Weekday(StartDate) If StartDateDay = vbThursday Then RollDate = StartDate + 7 Else Do StartDate = StartDate + 1 Loop Until Weekday(StartDate) = 5 RollDate = StartDate + 7 End If If Date < RollDate Then strMonth = arrMonth(DatePart("q", Date)) strYear = Right$(Year(Date), 1) Else If DatePart("q", Date) < 4 Then strMonth = arrMonth(DatePart("q", Date) + 1) strYear = Right$(Year(Date), 1) Else strMonth = arrMonth(1) strYear = Right$(Year(Date) + 1, 1) End If End If fxExpiry = strMonth & strYear End Function
Comment