Skip to content

Commit 3895f7e

Browse files
committed
add rate cutoff for the ois convention
1 parent cca17b6 commit 3895f7e

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

OREData/ored/configuration/conventions.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,12 @@ boost::shared_ptr<IborIndex> FraConvention::index() const { return parseIborInde
285285
OisConvention::OisConvention(const string& id, const string& spotLag, const string& index,
286286
const string& fixedDayCounter, const string& fixedCalendar, const string& paymentLag,
287287
const string& eom, const string& fixedFrequency, const string& fixedConvention,
288-
const string& fixedPaymentConvention, const string& rule, const string& paymentCal)
288+
const string& fixedPaymentConvention, const string& rule, const string& paymentCal,
289+
const string& rateCutoff)
289290
: Convention(id, Type::OIS), strSpotLag_(spotLag), strIndex_(index), strFixedDayCounter_(fixedDayCounter),
290291
strFixedCalendar_(fixedCalendar), strPaymentLag_(paymentLag), strEom_(eom), strFixedFrequency_(fixedFrequency),
291292
strFixedConvention_(fixedConvention), strFixedPaymentConvention_(fixedPaymentConvention), strRule_(rule),
292-
strPaymentCal_(paymentCal) {
293+
strPaymentCal_(paymentCal), strRateCutoff_(rateCutoff) {
293294
build();
294295
}
295296

@@ -306,6 +307,8 @@ void OisConvention::build() {
306307
strFixedPaymentConvention_.empty() ? Following : parseBusinessDayConvention(strFixedPaymentConvention_);
307308
rule_ = strRule_.empty() ? DateGeneration::Backward : parseDateGenerationRule(strRule_);
308309
paymentCal_ = strPaymentCal_.empty() ? Calendar() : parseCalendar(strPaymentCal_);
310+
rateCutoff_ = strRateCutoff_.empty() ? 0 : lexical_cast<Natural>(strRateCutoff_);
311+
309312
}
310313

311314
void OisConvention::fromXML(XMLNode* node) {
@@ -327,6 +330,7 @@ void OisConvention::fromXML(XMLNode* node) {
327330
strFixedPaymentConvention_ = XMLUtils::getChildValue(node, "FixedPaymentConvention", false);
328331
strRule_ = XMLUtils::getChildValue(node, "Rule", false);
329332
strPaymentCal_ = XMLUtils::getChildValue(node, "PaymentCalendar", false);
333+
strRateCutoff_ = XMLUtils::getChildValue(node, "RateCutoff", false);
330334

331335
build();
332336
}
@@ -354,6 +358,8 @@ XMLNode* OisConvention::toXML(XMLDocument& doc) {
354358
XMLUtils::addChild(doc, node, "Rule", strRule_);
355359
if (!strPaymentCal_.empty())
356360
XMLUtils::addChild(doc, node, "PaymentCalendar", strPaymentCal_);
361+
if (!strRateCutoff_.empty())
362+
XMLUtils::addChild(doc, node, "RateCutoff", strRateCutoff_);
357363

358364
return node;
359365
}

OREData/ored/configuration/conventions.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,8 @@ class OisConvention : public Convention {
381381
const string& fixedCalendar, const string& paymentLag = "", const string& eom = "",
382382
const string& fixedFrequency = "", const string& fixedConvention = "",
383383
const string& fixedPaymentConvention = "", const string& rule = "",
384-
const std::string& paymentCalendar = "");
384+
const std::string& paymentCalendar = "",
385+
const std::string& rateCutoff = "");
385386
//@}
386387

387388
//! \name Inspectors
@@ -399,6 +400,7 @@ class OisConvention : public Convention {
399400
BusinessDayConvention fixedPaymentConvention() const { return fixedPaymentConvention_; }
400401
DateGeneration::Rule rule() const { return rule_; }
401402
QuantLib::Calendar paymentCalendar() const { return paymentCal_; }
403+
Natural rateCutoff() const { return rateCutoff_; }
402404
//@}
403405

404406
//! \name Serialisation
@@ -419,6 +421,7 @@ class OisConvention : public Convention {
419421
BusinessDayConvention fixedPaymentConvention_;
420422
DateGeneration::Rule rule_;
421423
QuantLib::Calendar paymentCal_;
424+
Natural rateCutoff_;
422425

423426
// Strings to store the inputs
424427
string strSpotLag_;
@@ -432,6 +435,7 @@ class OisConvention : public Convention {
432435
string strFixedPaymentConvention_;
433436
string strRule_;
434437
std::string strPaymentCal_;
438+
string strRateCutoff_;
435439
};
436440

437441
//! Container for storing Ibor Index conventions

0 commit comments

Comments
 (0)