@@ -474,11 +474,20 @@ IRSwapConvention::IRSwapConvention(const string& id, const string& fixedCalendar
474474}
475475
476476void IRSwapConvention::build () {
477- fixedCalendar_ = parseCalendar (strFixedCalendar_);
478477 fixedFrequency_ = parseFrequency (strFixedFrequency_);
479- fixedConvention_ = parseBusinessDayConvention (strFixedConvention_);
480478 fixedDayCounter_ = parseDayCounter (strFixedDayCounter_);
481- parseIborIndex (strIndex_);
479+ auto ind = parseIborIndex (strIndex_);
480+
481+ if (strFixedCalendar_.empty ())
482+ fixedCalendar_ = ind->fixingCalendar ();
483+ else
484+ fixedCalendar_ = parseCalendar (strFixedCalendar_);
485+
486+ if (strFixedConvention_.empty ())
487+ fixedConvention_ = ind->businessDayConvention ();
488+ else
489+ fixedConvention_ = parseBusinessDayConvention (strFixedConvention_);
490+
482491 if (hasSubPeriod_) {
483492 floatFrequency_ = parseFrequency (strFloatFrequency_);
484493 subPeriodsCouponType_ = parseSubPeriodsCouponType (strSubPeriodsCouponType_);
@@ -495,13 +504,13 @@ void IRSwapConvention::fromXML(XMLNode* node) {
495504 id_ = XMLUtils::getChildValue (node, " Id" , true );
496505
497506 // Get string values from xml
498- strFixedCalendar_ = XMLUtils::getChildValue (node, " FixedCalendar" , true );
499507 strFixedFrequency_ = XMLUtils::getChildValue (node, " FixedFrequency" , true );
500- strFixedConvention_ = XMLUtils::getChildValue (node, " FixedConvention" , true );
501508 strFixedDayCounter_ = XMLUtils::getChildValue (node, " FixedDayCounter" , true );
502509 strIndex_ = XMLUtils::getChildValue (node, " Index" , true );
503510
504511 // optional
512+ strFixedCalendar_ = XMLUtils::getChildValue (node, " FixedCalendar" , false );
513+ strFixedConvention_ = XMLUtils::getChildValue (node, " FixedConvention" , false );
505514 strFloatFrequency_ = XMLUtils::getChildValue (node, " FloatFrequency" , false );
506515 strSubPeriodsCouponType_ = XMLUtils::getChildValue (node, " SubPeriodsCouponType" , false );
507516 hasSubPeriod_ = (strFloatFrequency_ != " " );
0 commit comments