Possible Bug in qlLiborSwap

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Possible Bug in qlLiborSwap

MikeD
Hello,

I think there is an issue with qlLiborSwap.  I noticed that when I build this object, the calendar being used is TARGET, even though I pass "USD" as the base currency.  Shouldn't QL be finding the dates using a joint implementation of UnitedStates::Settlement and UnitedKingdom::Settlement calendars?  I'm running qlXL v 0.9.7, and I don't have coding experience, so I'm sorry to say I probably won't be able to submit new code if there is in fact a bug.  Just thought I would bring this to everyone's attention.

- Mike

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Possible Bug in qlLiborSwap

Ferdinando M. Ametrano-2
Hi Mike

> I think there is an issue with qlLiborSwap.  I noticed that when I build
> this object, the calendar being used is TARGET, even though I pass "USD" as
> the base currency.

yes, you're right. It's a bug in the C++ layer, affecting all
currencies (but EUR)

> Shouldn't QL be finding the dates using a joint
> implementation of UnitedStates::Settlement and UnitedKingdom::Settlement
> calendars?

mmm... what are your sources? I'm not that much into USD, but USDLibor
uses UnitedStates::Settlement which should be be OK after a cursory
look at http://www.bbalibor.com/bba/jsp/polopoly.jsp?d=1634
What calendar should be used by UsdLiborSwap?

ciao -- Nando

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Possible Bug in qlLiborSwap

MikeD
>From what I've gathered so far from both Bloomberg and some swap dealers, USD denominated swaps use the UK calendar (UnitedKingdom::Settlement) for fixing and payment dates, as long as the resulting payment (not fixing) dates do not fall on a Federal Reserve holiday (i.e. the Federal Reserve bank wire system is open for clearing payments - http://www.federalreserve.gov/aboutthefed/k8.htm). 

Basically, any USD swap can be traded as long as there is a fixing on the trade date (so UK must be open but US can be closed).  If you follow the following framework for dates, you should not have any problems:

T0 (trade date), UK must be open to provide Libor fixing
T+1, UK must be open
T+2 (settlement), both US Fed Wire and UK must be open (but US exchanges can be closed)

Here are some examples:

7/1/10 (THU) (trade date) - both US and UK are open, so trade date is valid
7/2/10 (FRI) - UK is open, so this is our first business day toward settlement (T+1)
7/5/10 (MON) - UK is open, but US Fed Wire is closed, thus not a valid settlement date, move ahead one day.
7/6/10 (TUE) - UK is open, so this would be T+2 (settlement) as long as US Fed Wires are open (which they are), so this is the confirmed settlement date.

7/2/10 (FRI) (trade date) - both US and UK are open, so trade date is valid
7/5/10 (MON) - UK is open, so this counts as T+1
7/6/10 (TUE) - both UK and US Fed Wires are open, so this is T+2 (settlement)

12/24/10 (FRI) (trade date) - UK is open and Libor fixing would be set on this day, so trade date is valid
12/27/10 (MON) - Christmas observation in UK, so advance one day
12/28/10 (TUE) - Boxing Day in UK, so advance one day
12/29/10 (WED) - UK is open, so this counts as T+1
12/30/10 (THU) - both UK and US Fed Wires are open, so this is T+2 (settlement)

So from what I have gathered so far, quantlib should be using a joint calendar of UnitedKingdom::Settlement and a new Federal Reserve calendar for USD denominated swaps.

Also, since we are on the topic of calendars, check out May/June of 2012 in the UK calendars... June 5th is the Queens Diamond Jubilee, which ends up also changing the date of the Spring Bank Holiday (normally last Monday in May, but moved to first Monday in June). 

Sorry for the long-winded response, hopefully it helps...

- Mike


On Mon, Jun 21, 2010 at 11:11 AM, Ferdinando M. Ametrano <[hidden email]> wrote:
Hi Mike

> I think there is an issue with qlLiborSwap.  I noticed that when I build
> this object, the calendar being used is TARGET, even though I pass "USD" as
> the base currency.

yes, you're right. It's a bug in the C++ layer, affecting all
currencies (but EUR)

> Shouldn't QL be finding the dates using a joint
> implementation of UnitedStates::Settlement and UnitedKingdom::Settlement
> calendars?

mmm... what are your sources? I'm not that much into USD, but USDLibor
uses UnitedStates::Settlement which should be be OK after a cursory
look at http://www.bbalibor.com/bba/jsp/polopoly.jsp?d=1634
What calendar should be used by UsdLiborSwap?

ciao -- Nando


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users