Main Content

thirdwednesday

Find third Wednesday of month

Description

example

[BeginDates,EndDates] = thirdwednesday(Month,Year) computes the beginning and end period date for a LIBOR contract (third Wednesdays of delivery months).

example

[BeginDates,EndDates] = thirdwednesday(___,outputType), using optional input arguments, computes the beginning and end period date for a LIBOR contract (third Wednesdays of delivery months).

The type of the outputs depends on the input outputType. If this variable is 'datenum', BeginDates and EndDates are serial date numbers. If outputType is 'datetime', then BeginDates and EndDates are datetime arrays. By default, outputType is set to 'datenum'.

Examples

collapse all

Find the third Wednesday dates for swaps commencing in the month of October in the years 2002, 2003, and 2004.

Months = [10; 10; 10];
Year = [2002; 2003; 2004];
[BeginDates, EndDates] = thirdwednesday(Months, Year);
datestr(BeginDates)
ans = 3x11 char array
    '16-Oct-2002'
    '15-Oct-2003'
    '20-Oct-2004'

datestr(EndDates)
ans = 3x11 char array
    '16-Jan-2003'
    '15-Jan-2004'
    '20-Jan-2005'

Find the third Wednesday dates for swaps commencing in the month of October in the years 2002, 2003, and 2004 using an outputType of 'datetime'.

Months = [10; 10; 10];
Year = [2002; 2003; 2004];
[BeginDates, EndDates] = thirdwednesday(Months, Year,'datetime')
BeginDates = 3x1 datetime
   16-Oct-2002
   15-Oct-2003
   20-Oct-2004

EndDates = 3x1 datetime
   16-Jan-2003
   15-Jan-2004
   20-Jan-2005

Input Arguments

collapse all

Month of delivery for Eurodollar futures, specified as an N-by-1 vector of integers from 1 through 12.

Duplicate dates are returned when identical months and years are supplied.

Data Types: single | double

Delivery year for Eurodollar futures/Libor contracts corresponding to Month, specified as an N-by-1 vector of our-digit nonnegative integers.

Duplicate dates are returned when identical months and years are supplied.

Data Types: single | double

Output date format, specified as a character vector with values 'datenum' or 'datetime'. If outputType is 'datenum', then BeginDates and EndDates are serial date numbers. However, if outputType is 'datetime', then BeginDates and EndDates are datetime arrays.

Data Types: char

Output Arguments

collapse all

Third Wednesday of given month and year, returned as serial date numbers or date character vectors, or datetime arrays. This is also the beginning of the 3-month period contract.

The type of the outputs depends on the input outputType. If this variable is 'datenum', BeginDates and EndDates are serial date numbers. If outputType is 'datetime', thenBeginDates and EndDates are datetime arrays. By default, outputType is set to 'datenum'.

End of three-month period contract for given month and year, returned as serial date numbers or date character vectors, or datetime arrays.

The type of the outputs depends on the input outputType. If this variable is 'datenum', BeginDates and EndDates are serial date numbers. If outputType is 'datetime', thenBeginDates and EndDates are datetime arrays. By default, outputType is set to 'datenum'.

Version History

Introduced before R2006a