@@ -54,7 +54,15 @@ void OptionData::fromXML(XMLNode* node) {
5454 exerciseFeeSettlementCalendar_ = XMLUtils::getChildValue (node, " ExerciseFeeSettlementCalendar" , false );
5555 exerciseFeeSettlementConvention_ = XMLUtils::getChildValue (node, " ExerciseFeeSettlementConvention" , false );
5656 exercisePrices_ = XMLUtils::getChildrenValuesAsDoubles (node, " ExercisePrices" , " ExercisePrice" , false );
57- exerciseDates_ = XMLUtils::getChildrenValues (node, " ExerciseDates" , " ExerciseDate" , false );
57+
58+ if (XMLNode* n = XMLUtils::getChildNode (node, " ExerciseDates" )) {
59+ if (XMLNode* ed = XMLUtils::getChildNode (n, " ExerciseDate" )) {
60+ // For backward compatibility
61+ exerciseDates_ = XMLUtils::getChildrenValues (node, " ExerciseDates" , " ExerciseDate" );
62+ } else {
63+ exerciseDatesSchedule_.fromXML (n);
64+ }
65+ }
5866
5967 automaticExercise_ = boost::none;
6068 if (XMLNode* n = XMLUtils::getChildNode (node, " AutomaticExercise" ))
@@ -146,8 +154,14 @@ ExerciseBuilder::ExerciseBuilder(const OptionData& optionData, const std::vector
146154 // build vector of sorted exercise dates
147155
148156 std::vector<QuantLib::Date> sortedExerciseDates;
149- for (auto const & d : optionData.exerciseDates ())
150- sortedExerciseDates.push_back (parseDate (d));
157+ if (optionData.exerciseDatesSchedule ().hasData ()) {
158+ Schedule schedule = makeSchedule (optionData.exerciseDatesSchedule ());
159+ sortedExerciseDates = schedule.dates ();
160+ } else {
161+ // For backward compatibility
162+ for (auto const & d : optionData.exerciseDates ())
163+ sortedExerciseDates.push_back (parseDate (d));
164+ }
151165 std::sort (sortedExerciseDates.begin (), sortedExerciseDates.end ());
152166
153167 // build vector of alive exercise dates and corresponding native dates
0 commit comments