Re: [QuantLib-svn] SF.net SVN: quantlib:[15947] trunk/QuantLib

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

Re: [QuantLib-svn] SF.net SVN: quantlib:[15947] trunk/QuantLib

Luigi Ballabio
On Fri, 2009-02-20 at 13:37 +0000, [hidden email] wrote:

> Log Message:
> -----------
> removed redundant parameter
>
> Modified: trunk/QuantLib/ql/instruments/assetswap.cpp
> ===================================================================
> --- trunk/QuantLib/ql/instruments/assetswap.cpp 2009-02-20 13:36:45 UTC (rev 15946)
> +++ trunk/QuantLib/ql/instruments/assetswap.cpp 2009-02-20 13:37:51 UTC (rev 15947)
> @@ -35,16 +35,14 @@
>                           Real bondCleanPrice,
>                           const boost::shared_ptr<IborIndex>& index,
>                           Spread spread,
> -                         const Date& settlementDate,
>                           const Schedule& floatSch,
>                           const DayCounter& floatingDayCounter,
>                           bool parSwap)
> -    : Swap(2), spread_(spread), bondCleanPrice_(bondCleanPrice),
> -      settlementDate_(settlementDate) {
> +    : Swap(2), spread_(spread), bondCleanPrice_(bondCleanPrice) {
>  
>          Schedule schedule = floatSch;
>          if (floatSch.empty()) {
> -            schedule = Schedule(bond->settlementDate(settlementDate),
> +            schedule = Schedule(bond->settlementDate(),
>                                  bond->maturityDate(),
>                                  index->tenor(),
>                                  index->fixingCalendar(),


Not entirely redundant---before the change, if the reference date for
the term structure was 2 days from today, the schedule would start 5
days from today. Now it starts 3 days from today, so there was some
information in that parameter that cannot be retrieved elsewhere. The
question is, was the past behavior the correct one, or is the new one?

Luigi


--

Just remember what ol' Jack Burton does when the earth quakes, the
poison arrows fall from the sky, and the pillars of Heaven shake. Yeah,
Jack Burton just looks that big old storm right in the eye and says,
"Give me your best shot. I can take it."
-- Jack Burton, "Big trouble in Little China"



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: [QuantLib-svn] SF.net SVN: quantlib:[15947] trunk/QuantLib

Ferdinando Ametrano-4
On Fri, Feb 20, 2009 at 2:56 PM, Luigi Ballabio
<[hidden email]> wrote:
> before the change, if the reference date for
> the term structure was 2 days from today, the schedule would start 5
> days from today. Now it starts 3 days from today, so there was some
> information in that parameter that cannot be retrieved elsewhere. The
> question is, was the past behavior the correct one, or is the new one?

the new one.

If the user doesn't input an explicit schedule the default assumption
has always been that he is pricing an asset swap with today as trade
date, i.e. with 3 settlement days in the case of EUR bond.
As a matter of fact both Chiara and I (which wrote the original code)
have been always using it this way with a discount curve's reference
date equal to today. Your refactoring just pointed out the possible
unexpected behaviour of 2+3 settlement days, which would not make
sense as default behaviour, whatever is your choice for the discount
curve's reference date.

ciao -- Nando

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev