C++ Quantlib 掉期付款日期
C++ Quantlib Swap Payment Dates
当我使用 Quantlib 为普通利率掉期定价时,每笔现金流的支付日期始终与应计期结束日期相同。这是我通常用来设置普通交换的方式:
Schedule fixedSchedule(previousResetDate, maturity, 6 * Months, NullCalendar(), ModifiedFollowing, ModifiedFollowing, DateGeneration::Backward, false);
Schedule floatSchedule(previousResetDate, maturity, 3 * Months, NullCalendar(), ModifiedFollowing, ModifiedFollowing, DateGeneration::Backward, false);
VanillaSwap swap(VanillaSwap::Receiver, nominal, fixedSchedule, fixedRate, Thirty360(), floatSchedule, libor, spread, Actual360());
在实践中,有些掉期的付款日期可能与应计期结束日期不同。例如,应计结束日期后 2 天,然后应用工作日惯例调整。我只是想知道是否可以在 Quantlib 中以这种方式设置付款日期?
非常感谢。
您可以随时提供自己的付款日期,例如:
Schedule(std::vector<Date> { Date(1, Jan, 2016 }, Date(1, Jan, 2017 } });
执行此操作的构造函数是:
Schedule(const std::vector<Date>&,
const Calendar& calendar = NullCalendar(),
const BusinessDayConvention
convention = Unadjusted,
boost::optional<BusinessDayConvention>
terminationDateConvention = boost::none,
const boost::optional<Period> tenor = boost::none,
boost::optional<DateGeneration::Rule> rule = boost::none,
boost::optional<bool> endOfMonth = boost::none,
const std::vector<bool>& isRegular = std::vector<bool>(0));
不,目前无法获得您想要的行为。我想这需要将相关代码添加到 FixedRateLeg
和 IborLeg
类,因为那是拆开时间表并创建优惠券的地方。
当我使用 Quantlib 为普通利率掉期定价时,每笔现金流的支付日期始终与应计期结束日期相同。这是我通常用来设置普通交换的方式:
Schedule fixedSchedule(previousResetDate, maturity, 6 * Months, NullCalendar(), ModifiedFollowing, ModifiedFollowing, DateGeneration::Backward, false);
Schedule floatSchedule(previousResetDate, maturity, 3 * Months, NullCalendar(), ModifiedFollowing, ModifiedFollowing, DateGeneration::Backward, false);
VanillaSwap swap(VanillaSwap::Receiver, nominal, fixedSchedule, fixedRate, Thirty360(), floatSchedule, libor, spread, Actual360());
在实践中,有些掉期的付款日期可能与应计期结束日期不同。例如,应计结束日期后 2 天,然后应用工作日惯例调整。我只是想知道是否可以在 Quantlib 中以这种方式设置付款日期?
非常感谢。
您可以随时提供自己的付款日期,例如:
Schedule(std::vector<Date> { Date(1, Jan, 2016 }, Date(1, Jan, 2017 } });
执行此操作的构造函数是:
Schedule(const std::vector<Date>&,
const Calendar& calendar = NullCalendar(),
const BusinessDayConvention
convention = Unadjusted,
boost::optional<BusinessDayConvention>
terminationDateConvention = boost::none,
const boost::optional<Period> tenor = boost::none,
boost::optional<DateGeneration::Rule> rule = boost::none,
boost::optional<bool> endOfMonth = boost::none,
const std::vector<bool>& isRegular = std::vector<bool>(0));
不,目前无法获得您想要的行为。我想这需要将相关代码添加到 FixedRateLeg
和 IborLeg
类,因为那是拆开时间表并创建优惠券的地方。