Hi Michael
Schedule also has constructor that take irregular dates.
Here is the C++ constrictor,
Schedule
<https://rkapl123.github.io/QLAnnotatedSource/d5/d5b/class_quant_lib_1_1_schedule.html#a19ab5a444f1f8c74856f75a8e16915d4>
(const std::vector< Date
<https://rkapl123.github.io/QLAnnotatedSource/db/d60/class_quant_lib_1_1_date.html>
> &, Calendar
<https://rkapl123.github.io/QLAnnotatedSource/da/d3e/class_quant_lib_1_1_calendar.html>
calendar
<https://rkapl123.github.io/QLAnnotatedSource/d5/d5b/class_quant_lib_1_1_schedule.html#a4ffdceafee5fe94e7646e4f04300ba18>
=NullCalendar
<https://rkapl123.github.io/QLAnnotatedSource/da/d77/class_quant_lib_1_1_null_calendar.html>
(), BusinessDayConvention
<https://rkapl123.github.io/QLAnnotatedSource/d1/d37/group__datetime.html#gaff46c5ae9385d20709bedade86edd368>
convention=Unadjusted
<https://rkapl123.github.io/QLAnnotatedSource/d1/d37/group__datetime.html#ggaff46c5ae9385d20709bedade86edd368a5fb8b90b7fdf1a3a228fbbc083e64547>,
const ext::optional< BusinessDayConvention
<https://rkapl123.github.io/QLAnnotatedSource/d1/d37/group__datetime.html#gaff46c5ae9385d20709bedade86edd368>
> &terminationDateConvention=ext::nullopt
<https://rkapl123.github.io/QLAnnotatedSource/d4/d5c/namespace_quant_lib_1_1ext.html#a3d1f3fb2cb126ecea6a56dd80734c3d3>,
const ext::optional< Period
<https://rkapl123.github.io/QLAnnotatedSource/df/dfa/class_quant_lib_1_1_period.html>
> &tenor
<https://rkapl123.github.io/QLAnnotatedSource/d5/d5b/class_quant_lib_1_1_schedule.html#afc2f7230de3dbcc6b4808594aec7eb5e>
=ext::nullopt
<https://rkapl123.github.io/QLAnnotatedSource/d4/d5c/namespace_quant_lib_1_1ext.html#a3d1f3fb2cb126ecea6a56dd80734c3d3>,
const ext::optional< DateGeneration::Rule
<https://rkapl123.github.io/QLAnnotatedSource/dc/dcb/struct_quant_lib_1_1_date_generation.html#a11fcd51ef86118f65e603c1474377a78>
> &rule
<https://rkapl123.github.io/QLAnnotatedSource/d5/d5b/class_quant_lib_1_1_schedule.html#ab66924874e68d30a2306b3f2b2c732a0>
=ext::nullopt
<https://rkapl123.github.io/QLAnnotatedSource/d4/d5c/namespace_quant_lib_1_1ext.html#a3d1f3fb2cb126ecea6a56dd80734c3d3>,
const ext::optional< bool
<https://rkapl123.github.io/QLAnnotatedSource/d9/db9/classbool.html> > &
endOfMonth
<https://rkapl123.github.io/QLAnnotatedSource/d5/d5b/class_quant_lib_1_1_schedule.html#a76bf4d1422680b11983bf2908b42a9d5>
=ext::nullopt
<https://rkapl123.github.io/QLAnnotatedSource/d4/d5c/namespace_quant_lib_1_1ext.html#a3d1f3fb2cb126ecea6a56dd80734c3d3>,
std::vector< bool
<https://rkapl123.github.io/QLAnnotatedSource/d9/db9/classbool.html> >
isRegular
<https://rkapl123.github.io/QLAnnotatedSource/d5/d5b/class_quant_lib_1_1_schedule.html#a63e84fe150fbc4f4b18b0b52e75cac06>
=std::vector< bool
<https://rkapl123.github.io/QLAnnotatedSource/d9/db9/classbool.html> >(0))
Following is a sample Python code.
payment_dates = [ql.Date(1,8,2023), ql.Date(7,12,2023), ql.Date(1,4,2024),
ql.Date(27,5,2024)]
is_regular_period = [False, False, False]
irregularSchedule = ql.Schedule(payment_dates, ql.NullCalendar(),
ql.Unadjusted, None, None, None, True,is_regular_period)
Best,
Steve
On Fri, Sep 8, 2023 at 5:33 AM Michael (DataDriven portal) <
mi...@da...> wrote:
> Hi All,
>
> I have a bond with irregular schedule dates and would like to set up the
> bond's Schedule using the list of dates e.g. like *[Date(15,1,2015),
> Date(15,7,2015), Date(15,7,2016)].* Is it possible to do this in QuantLib?
>
> The only syntax for Schedule that I found (below) allows to create a
> schedule for a given frequency, frequency, etc
>
> *ql.Schedule(issueDate, maturityDate,ql.Period(ql.Annual), ql.TARGET(),
> ql.Following, ql.Following, ql.DateGeneration.Backward, False)*
>
> I would appreciate any help!
>
> Thanks,
>
> Michael
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|