Re: Simple Expiration Date Handling

Posted by Ferdinando M. Ametrano-3 on
URL: http://quantlib.414.s1.nabble.com/Simple-Expiration-Date-Handling-tp5105p5112.html

Hi all

>   1)  Logic about third Friday after the third Thursday.  This is cake and a
> simple conditional-if or case statement will work fine.
>   2)  Incorporate holiday checking and handling into step one above and
> determine when the rearranged expiration time is set.  Does anyone know the
> rule for this?
What happen if the Friday after the third Thursday is an holiday?
If the expiry day just rolls up to the next business day, what about:
static Date fridayAfterThirdThursday(Calendar c, Month m, Year y) {
    Date thirdThursday = nthWeekday(3, Thursday, m, y);
    Date result = nextWeekday(thirdThursday, Friday);
    result = c.adjust(result, Following);
}

if this is what you are looking for I can add it to QuantLib.

> p.s. Two years ago I wrote about working with a FpML/XML parser.  A large
> list of exchange traded options could be handled smoothly if these things
> were implemented properly.
We are very interested about FpMLsupport/compliance. Please look the
mailing list archives for related threads.

ciao -- Nando