11/*
22 Copyright (C) 2016 Quaternion Risk Management Ltd
3+ Copyright (C) 2024 Oleg Kulkov
34 All rights reserved.
45
56 This file is part of ORE, a free-software/open-source library
@@ -285,11 +286,12 @@ QuantLib::ext::shared_ptr<IborIndex> FraConvention::index() const { return parse
285286OisConvention::OisConvention (const string& id, const string& spotLag, const string& index,
286287 const string& fixedDayCounter, const string& fixedCalendar, const string& paymentLag,
287288 const string& eom, const string& fixedFrequency, const string& fixedConvention,
288- const string& fixedPaymentConvention, const string& rule, const string& paymentCal)
289+ const string& fixedPaymentConvention, const string& rule, const string& paymentCal,
290+ const string& rateCutoff)
289291 : Convention(id, Type::OIS), strSpotLag_(spotLag), strIndex_(index), strFixedDayCounter_(fixedDayCounter),
290292 strFixedCalendar_(fixedCalendar), strPaymentLag_(paymentLag), strEom_(eom), strFixedFrequency_(fixedFrequency),
291293 strFixedConvention_(fixedConvention), strFixedPaymentConvention_(fixedPaymentConvention), strRule_(rule),
292- strPaymentCal_(paymentCal) {
294+ strPaymentCal_(paymentCal), strRateCutoff_(rateCutoff) {
293295 build ();
294296}
295297
@@ -306,6 +308,8 @@ void OisConvention::build() {
306308 strFixedPaymentConvention_.empty () ? Following : parseBusinessDayConvention (strFixedPaymentConvention_);
307309 rule_ = strRule_.empty () ? DateGeneration::Backward : parseDateGenerationRule (strRule_);
308310 paymentCal_ = strPaymentCal_.empty () ? Calendar () : parseCalendar (strPaymentCal_);
311+ rateCutoff_ = strRateCutoff_.empty () ? 0 : lexical_cast<Natural>(strRateCutoff_);
312+
309313}
310314
311315void OisConvention::fromXML (XMLNode* node) {
@@ -327,6 +331,7 @@ void OisConvention::fromXML(XMLNode* node) {
327331 strFixedPaymentConvention_ = XMLUtils::getChildValue (node, " FixedPaymentConvention" , false );
328332 strRule_ = XMLUtils::getChildValue (node, " Rule" , false );
329333 strPaymentCal_ = XMLUtils::getChildValue (node, " PaymentCalendar" , false );
334+ strRateCutoff_ = XMLUtils::getChildValue (node, " RateCutoff" , false );
330335
331336 build ();
332337}
@@ -354,6 +359,8 @@ XMLNode* OisConvention::toXML(XMLDocument& doc) const {
354359 XMLUtils::addChild (doc, node, " Rule" , strRule_);
355360 if (!strPaymentCal_.empty ())
356361 XMLUtils::addChild (doc, node, " PaymentCalendar" , strPaymentCal_);
362+ if (!strRateCutoff_.empty ())
363+ XMLUtils::addChild (doc, node, " RateCutoff" , strRateCutoff_);
357364
358365 return node;
359366}
0 commit comments