Period to frequency conversion.

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

Period to frequency conversion.

Slava Mazur
Greetings,

Is there any particular reason for restrictions in Period::frequency()
method on the length in weeks and days?

Firstly, it looks inconsistent with handling of months. Why in a similar
manner couldn't it translate weeks and days via Frequency(52/length) and
Frequency(366/length) respectively?

Secondly, I have a real issue with such a restriction. I need to setup a
fixed rate bond that pays coupon every 182 days unadjusted. So, in
setting up a schedule I specified tenor as 182D or 26W, but the
constructor of FixedRateBond object ends up in exception when such a
schedule is passed as an input parameter. It would be okay for me if
such a bond would have semiannual settings for frequency; moreover it
looks like in majority cases "frequency" plays just a "decorative" role.
Is there any workaround?

Thanks,

Slava Mazur


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Period to frequency conversion.

Luigi Ballabio
On Thu, 2008-07-31 at 15:58 -0400, Slava Mazur wrote:
> Is there any particular reason for restrictions in Period::frequency()
> method on the length in weeks and days?

Not really---I guess it was so that we could return a frequency. Since
in most cases this is only a cosmetic requirement, we could get away by
returning an unknown frequency instead of throwing an exception. Would
this be ok for you? Are you willing to write a patch?

Later,
        Luigi


--

It is better to know some of the questions than all of the answers.
-- James Thurber



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev