File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
ql/pricingengines/vanilla Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -90,11 +90,18 @@ namespace QuantLib {
90
90
91
91
if (divDate <= exerciseDate && divDate >= settlementDate) {
92
92
const Real divAmount = (*divIter)->amount ();
93
- const DiscountFactor discount =
94
- process_->riskFreeRate ()->discount (divDate) /
95
- process_->dividendYield ()->discount (divDate);
96
93
97
- spotAdjustment -= divAmount * discount;
94
+ if (divAmount != 0.0 ) {
95
+ QL_REQUIRE (arguments_.exercise ->type ()
96
+ == Exercise::European,
97
+ " Escrowed dividend model expects an European option" );
98
+
99
+ const DiscountFactor discount =
100
+ process_->riskFreeRate ()->discount (divDate) /
101
+ process_->dividendYield ()->discount (divDate);
102
+
103
+ spotAdjustment -= divAmount * discount;
104
+ }
98
105
}
99
106
}
100
107
Original file line number Diff line number Diff line change @@ -827,7 +827,6 @@ void DividendOptionTest::testFdAmericanGreeks() {
827
827
Date exDate = today + lengths[i]*Years;
828
828
ext::shared_ptr<Exercise> exercise (new AmericanExercise (today,exDate));
829
829
testFdGreeks (today,exercise,FdBlackScholesVanillaEngine::Spot);
830
- testFdGreeks (today,exercise,FdBlackScholesVanillaEngine::Escrowed);
831
830
}
832
831
}
833
832
@@ -1028,7 +1027,6 @@ void DividendOptionTest::testFdAmericanWithDividendToday() {
1028
1027
ext::shared_ptr<Exercise> exercise (new AmericanExercise (today,exDate));
1029
1028
1030
1029
testFdDividendAtTZero (today,exercise,FdBlackScholesVanillaEngine::Spot);
1031
- testFdDividendAtTZero (today,exercise,FdBlackScholesVanillaEngine::Escrowed);
1032
1030
}
1033
1031
1034
1032
You can’t perform that action at this time.
0 commit comments