@@ -492,28 +492,32 @@ void ConvertibleBond::build(const boost::shared_ptr<ore::data::EngineFactory>& e
492492 }
493493 }
494494
495- // for cross currency, add required FX fixings for dividend history
495+ // for cross currency, add required FX fixings for conversion and dividend history
496496
497- if (fx != nullptr && equity != nullptr ) {
497+ if (fx != nullptr ) {
498498
499499 Date d0 = qlUnderlyingBond->startDate ();
500500 Date d1 = qlUnderlyingBond->maturityDate ();
501501
502502 // FIXME, the following only works, if we have the dividends loaded at this point...
503- auto div = equity->dividendFixings ();
504- for (auto const & d : div) {
505- if (d.exDate >= d0) {
506- requiredFixings_.addFixingDate (fx->fixingCalendar ().adjust (d.exDate , Preceding),
507- data_.conversionData ().fxIndex ());
503+ if (equity != nullptr ) {
504+ auto div = equity->dividendFixings ();
505+ for (auto const & d : div) {
506+ if (d.exDate >= d0) {
507+ requiredFixings_.addFixingDate (fx->fixingCalendar ().adjust (d.exDate , Preceding),
508+ data_.conversionData ().fxIndex ());
509+ }
508510 }
509511 }
510512
511513 Date today = Settings::instance ().evaluationDate ();
512514 d0 = std::min (d0, today);
513515
514516 // ...as a workaround, we add all fx fixings from min(today, bond start date) to maturity
517+ // -> this also covers the required fx fixings for conversion, so we don't have to add them separately
515518 for (Date d = d0; d <= d1; ++d) {
516- requiredFixings_.addFixingDate (fx->fixingCalendar ().adjust (d, Preceding), data_.conversionData ().fxIndex ());
519+ requiredFixings_.addFixingDate (fx->fixingCalendar ().adjust (d, Preceding), data_.conversionData ().fxIndex (),
520+ Date::maxDate (), false , false );
517521 }
518522 }
519523
0 commit comments