Re: schedule / full interface

Posted by Peter Caspers-4 on
URL: http://quantlib.414.s1.nabble.com/schedule-full-interface-tp16512p16522.html

Hi Ed,

yes I guess that would work as well for the specific case. I would
have to remove the first date from the list of holidays of the TARGET
calendar. This can be tricky, since I think this very same calendar is
used to adjust the schedule's dates to get the payment dates. But
since there is not payment on the first schedule entry, it should be
ok. Thank you for this.

best regards
Peter


On 27 April 2015 at 22:44, Ed James <[hidden email]> wrote:

> Hi All,
>
>           I’m new to Quantlib so apologies if I’ve missed the point about
> your objective but for a swap with a nearly regular schedule, the only
> exception being that the first date is a holiday, could you not just add
> that holiday date to the Calendar object which is then passed into the
> Schedule object via the rules based constructor. The first date will then
> get adjusted based on the business day convention.
>
>          I can see why you’d need a more comprehensive solution if the dates
> are at irregular intervals but the original case looks reachable with a
> regular schedule plus a holiday adjustment.
>
>
>
> Thanks
>
> Ed James
>
>
>
> From: Francois Botha [mailto:[hidden email]]
> Sent: 26 April 2015 21:16
> To: Peter Caspers
> Cc: Luigi Ballabio; QuantLib users
> Subject: Re: [Quantlib-users] schedule / full interface
>
>
>
> Hi Peter,
>
>
>
> At a glance, it sounds good to me too. I'll be able to tell only later.
>
>
>
> thanks
>
>
> Francois Botha
>
>
>
> On 25 April 2015 at 18:45, Peter Caspers <[hidden email]> wrote:
>
> I will try to send a PR which does that. Francois, you'd be happy with
> that kind of solution, too ?
> Peter
>
>
> On 25 April 2015 at 09:02, Luigi Ballabio <[hidden email]> wrote:
>> Yes, this would work.
>>
>> Luigi
>>
>> On Apr 25, 2015 8:52 AM, "Peter Caspers" <[hidden email]> wrote:
>>>
>>> ok thanks. Couldn't we do it just like that:
>>>
>>> Extend the already existing constructor (taking a vector of dates, a
>>> calendar and bdc) such that it accepts the other stuff (termination
>>> date convention, generation rule, tenor, end of month flag, a vector
>>> of booleans indicating regular periods, I guess that's it). Everything
>>> except the first vector of dates should be wrapped in boost::optional
>>> and defaulted to null.
>>>
>>> The inspector fullInterface() returns true if either the rule based
>>> constructor is used or the other one and _all_ meta information is not
>>> null.
>>>
>>> The single inspectors for the meta data return the meta data piece
>>> that is required, if not null, and throws otherwise (i.e. it does not
>>> check for the full interface given, only for the requested piece of
>>> information to be available).
>>>
>>> As far as I can see that would be a pragmatic solution giving full
>>> flexibility, wouldn't it ?
>>>
>>> Peter
>>>
>>>
>>> On 25 April 2015 at 00:38, Francois Botha <[hidden email]> wrote:
>>> > I remember I had a similar problem:
>>> >
>>> >
>>> > http://quantlib.10058.n7.nabble.com/End-of-month-bond-coupons-for-leap-years-td15311.html
>>> >
>>> > It's been on my todo list to see if I can create a constructor for the
>>> > Schedule to accept an array of dates.
>>> >
>>> > Francois Botha
>>> >
>>> > On 24 April 2015 at 20:31, Peter Caspers <[hidden email]>
>>> > wrote:
>>> >>
>>> >> Hello,
>>> >>
>>> >> I need to set up a swap with a nearly regular schedule. The only
>>> >> exception is the first date which is on a holiday. The clean way to
>>> >> generate this would be (?)
>>> >>
>>> >> - generate a preliminary schedule using the schedule's class date
>>> >> generation machinery
>>> >> - extract the dates, overwrite the first one with the correct value
>>> >> and then set up the final schedule based on this date vector
>>> >>
>>> >> However when feeding the second schedule into a VanillaSwap
>>> >> instrument, it complains that the schedule need to support the full
>>> >> interface, as far as I can see to extract the calendar and businessday
>>> >> convention which are used to get payment dates from the schedule
>>> >> dates.
>>> >>
>>> >> What can I do now ? As a workaround I just added a method
>>> >>
>>> >>         std::vector<Date>& datesModifyable() { return dates_; }
>>> >>
>>> >> to the schedule class which allows to modify the generated dates, but
>>> >> retaining the full interface. But this is not meant like this, is it ?
>>> >>
>>> >> Can we somehow make the schedule class more flexible without breaking
>>> >> something ?
>>> >>
>>> >> Thanks
>>> >> Peter
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> ------------------------------------------------------------------------------
>>> >> One dashboard for servers and applications across
>>> >> Physical-Virtual-Cloud
>>> >> Widest out-of-the-box monitoring support with 50+ applications
>>> >> Performance metrics, stats and reports that give you Actionable
>>> >> Insights
>>> >> Deep dive visibility with transaction tracing using APM Insight.
>>> >> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>>> >> _______________________________________________
>>> >> QuantLib-users mailing list
>>> >> [hidden email]
>>> >> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>> >
>>> >
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> One dashboard for servers and applications across Physical-Virtual-Cloud
>>> Widest out-of-the-box monitoring support with 50+ applications
>>> Performance metrics, stats and reports that give you Actionable Insights
>>> Deep dive visibility with transaction tracing using APM Insight.
>>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>>> _______________________________________________
>>> QuantLib-users mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
>

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users