[英]C++ Quantlib Vanilla Swap: setting future fixing dates and gearing for floating leg
[英]C++ Quantlib Swap Payment Dates
當我使用 Quantlib 為普通利率掉期定價時,每個現金流的支付日期始終與應計期結束日期相同。 這是我通常用來設置 vanilla 交換的方式:
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 中以這種方式設置付款日期?
非常感謝。
不,目前無法獲得您想要的行為。 我想這需要將相關代碼添加到FixedRateLeg
和IborLeg
類,因為這是分解時間表和創建優惠券的地方。
您可以隨時提供自己的付款日期,例如:
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));
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.