Skip to content

Commit 44fcd9f

Browse files
damienbarkerjenkins
authored andcommitted
QPR-11916 Check end date is after end date
1 parent 95d4e92 commit 44fcd9f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

OREData/ored/portfolio/indexcreditdefaultswapoption.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ void IndexCreditDefaultSwapOption::build(const boost::shared_ptr<EngineFactory>&
135135
Date exerciseDate = parseDate(exerciseDates.front());
136136
boost::shared_ptr<Exercise> exercise = boost::make_shared<EuropeanExercise>(exerciseDate);
137137

138+
QL_REQUIRE(parseDate(legData.schedule().rules().front().startDate()) > exerciseDate,
139+
"IndexCreditDefaultSwapOption: ExerciseDate must be before EndDate");
140+
138141
// We apply an automatic correction to a common mistake in the input data, where the full index underlying
139142
// is provided and not only the part of the underlying into which we exercise.
140143
if (legData.schedule().rules().size() == 1 && legData.schedule().dates().empty()) {

0 commit comments

Comments
 (0)