Documentation

thirdwednesday

Find third Wednesday of month

Syntax

[BeginDates, EndDates] = thirdwednesday(Month, Year, outputType)

Arguments

Month

Month of delivery for Eurodollar futures.

Year

Four-digit year of delivery for Eurodollar futures, in sequence corresponding to a month in the Month input argument.

outputType

(Optional) A character vector specified as either 'datenum' or 'datetime'. The output Date will be in serial date format if 'datenum' is specified or datetime format if 'datetime' is specified. By default the output will be in serial date format.

Inputs can be scalars or n-by-1 vectors.

Description

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

BeginDates is the beginning of three-month period contract as specified by Month and Year.

EndDates is the end of three-month period contract as specified by Month and Year.

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

    Notes  

    • All dates are returned as date numbers that depend on input outputType. Convert to character vectors using datestr.

    • The function returns duplicates if you supply identical months and years.

    • The function supports dates from January 2000 to December 2099.

Examples

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 =

16-Oct-2002
15-Oct-2003
20-Oct-2004
datestr(EndDates)
ans =

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 = 

   16-Oct-2002
   15-Oct-2003
   20-Oct-2004


EndDates = 

   16-Jan-2003
   15-Jan-2004
   20-Jan-2005

Related Examples

See Also

|

Introduced before R2006a

Was this topic helpful?