Fixed periods in a swap

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

Fixed periods in a swap

Henner Heck

Hello all,

i would like to know, how i can create a swap, which has unadjusted (fixed) period lengths
(always the same accrual period, therefore the same rate), but adjusted payment dates.
I suspect, that the two BusinessdayConvention parameters "convention" and
"terminationDateConvention" from the "QuantLib::Schedule" constructor and the optional
BusinessdayConvention "paymentConvention" from the VanillaSwap constructor are the places to look at.

Am i correct with the following assumptions? (If not, please give me the correct version. :)  )

paymentConvention:
Determines, how the payment dates of the cash flows are adjusted from their
original value from the schedule, if they happen to be on a weekend or holiday.

convention:
Determines, if and how the periods between the cashflows are adjusted (Following, ModifiedFollowing, etc.)
or not (Unadjusted and therefore fixed).
If "paymentConvention" is not set in the Swap, "convention" of the floating leg schedule is used as default setting for it
-> If the floating leg "convention" is "Unadjusted" and "paymentConvention" is not explicitely set,
i could end up with payment dates on weekends or holidays!?

terminationDateConvention:
Some special treatment of the last period or payment date?


In the Java classes i get from the SWIG interface files, the optional parameter "paymentConvention"
is not available for QuantLib::VanillaSwap. Any chance of making it available?


Best regards,
Henner Heck




--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Fixed periods in a swap

Henner Heck

I think this one should have gone to the users mailing list.

Sorry.

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Fixed periods in a swap

Luigi Ballabio
On Tue, 2011-02-01 at 11:55 +0100, Henner Heck wrote:
> I think this one should have gone to the users mailing list.

No problem.  Often I get confused too.  We probably should have made
just one to begin with...

Luigi


--

When all else fails, pour a pint of Guinness in the gas tank,
advance the spark 20 degrees, cry "God Save the Queen!", and pull
the starter knob.
-- MG "Series MGA" Workshop Manual



------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Fixed periods in a swap

Henner Heck

Am 01.02.2011, 14:30 Uhr, schrieb Luigi Ballabio  
<[hidden email]>:

> On Tue, 2011-02-01 at 11:55 +0100, Henner Heck wrote:
>> I think this one should have gone to the users mailing list.
>
> No problem.  Often I get confused too.  We probably should have made
> just one to begin with...
>
> Luigi

  :)

Still, any idea on adding the parameter in SWIG?
>> In the Java classes i get from the SWIG interface files, the optional  
>> parameter "paymentConvention"
>> is not available for QuantLib::VanillaSwap. Any chance of making it  
>> available?


>
>


--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Fixed periods in a swap

Luigi Ballabio
On Tue, 2011-02-01 at 15:35 +0100, Henner Heck wrote:
> Still, any idea on adding the parameter in SWIG?
> >> In the Java classes i get from the SWIG interface files, the optional  
> >> parameter "paymentConvention"
> >> is not available for QuantLib::VanillaSwap. Any chance of making it  
> >> available?

I still have to figure out how to export boost::optional.
In the meantime, you can add an overloaded constructor that takes all
parameters including the paymentConvention (just duplicate the existing
one in the %extend section, add the parameter, and use it to create the
VanillaSwap being allocated.)

Luigi


--

All generalizations are dangerous, even this one.
-- Alexandre Dumas



------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Fixed periods in a swap

Henner Heck


Yes, the boost::optional seems tricky.
I'll do as you suggested until it's solved.

Thank you,
Henner


Am 01.02.2011, 15:41 Uhr, schrieb Luigi Ballabio  
<[hidden email]>:

> On Tue, 2011-02-01 at 15:35 +0100, Henner Heck wrote:
>> Still, any idea on adding the parameter in SWIG?
>> >> In the Java classes i get from the SWIG interface files, the optional
>> >> parameter "paymentConvention"
>> >> is not available for QuantLib::VanillaSwap. Any chance of making it
>> >> available?
>
> I still have to figure out how to export boost::optional.
> In the meantime, you can add an overloaded constructor that takes all
> parameters including the paymentConvention (just duplicate the existing
> one in the %extend section, add the parameter, and use it to create the
> VanillaSwap being allocated.)
>
> Luigi
>
>


--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Fixed periods in a swap

Luigi Ballabio
On Tue, 2011-02-01 at 15:55 +0100, Henner Heck wrote:
> Yes, the boost::optional seems tricky.

Also, it depends on the language.  For Python, one can write a typemap
so that the wrapped function accepts either a value or None, and maps
the latter to boost::none.  For Java, is there any such null value?

Luigi


--

The shortest way to do many things is to do only one thing at once.
-- Samuel Smiles



------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Fixed periods in a swap

Henner Heck

There is no such value, though Java offers a "varargs" construct
marked by "ParamType... ParamName" in the parameter list, which
can represent any number of arguments of the given type.

http://download.oracle.com/javase/tutorial/java/javaOO/arguments.html

Maybe it can be used in combination with SWIG varargs?

http://www.swig.org/Doc2.0/Varargs.html#Varargs_nn4


Best regards,
Henner Heck






Am 01.02.2011, 16:06 Uhr, schrieb Luigi Ballabio <[hidden email]>:

> On Tue, 2011-02-01 at 15:55 +0100, Henner Heck wrote:
>> Yes, the boost::optional seems tricky.
>
> Also, it depends on the language. For Python, one can write a typemap
> so that the wrapped function accepts either a value or None, and maps
> the latter to boost::none. For Java, is there any such null value?
>
> Luigi
>
>


--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/mail/

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev