@@ -206,7 +206,7 @@ boost::shared_ptr<PricingEngine> LGMGridBermudanSwaptionEngineBuilder::engineImp
206206 const std::vector<Date>& expiries,
207207 const Date& maturity,
208208 const std::vector<Real>& strikes) {
209- DLOG (" Building Bermudan Swaption engine for trade " << id);
209+ DLOG (" Building LGM Grid Bermudan Swaption engine for trade " << id);
210210
211211 boost::shared_ptr<QuantExt::LGM> lgm = model (id, key, expiries, maturity, strikes);
212212
@@ -224,6 +224,29 @@ boost::shared_ptr<PricingEngine> LGMGridBermudanSwaptionEngineBuilder::engineImp
224224 lgm, sy, ny, sx, nx, market_->discountCurve (ccy, configuration (MarketContext::pricing)));
225225}
226226
227+ boost::shared_ptr<PricingEngine> LGMFDBermudanSwaptionEngineBuilder::engineImpl (const string& id, const string& key,
228+ const std::vector<Date>& expiries,
229+ const Date& maturity,
230+ const std::vector<Real>& strikes) {
231+ DLOG (" Building LGM FD Bermudan Swaption engine for trade " << id);
232+
233+ boost::shared_ptr<QuantExt::LGM> lgm = model (id, key, expiries, maturity, strikes);
234+
235+ DLOG (" Get engine data" );
236+ Size stateGridPoints = parseInteger (engineParameter (" StateGridPoints" ));
237+ Size timeStepsPerYear = parseInteger (engineParameter (" TimeStepsPerYear" ));
238+ Real mesherEpsilon = parseReal (engineParameter (" MesherEpsilon" ));
239+
240+ Real maxTime = lgm->termStructure ()->timeFromReference (maturity);
241+
242+ DLOG (" Build engine (configuration " << configuration (MarketContext::pricing) << " )" );
243+ boost::shared_ptr<IborIndex> index;
244+ std::string ccy = tryParseIborIndex (key, index) ? index->currency ().code () : key;
245+ return boost::make_shared<QuantExt::NumericLgmMultiLegOptionEngine>(
246+ lgm, maxTime, stateGridPoints, timeStepsPerYear, mesherEpsilon,
247+ market_->discountCurve (ccy, configuration (MarketContext::pricing)));
248+ }
249+
227250boost::shared_ptr<PricingEngine> LgmMcBermudanSwaptionEngineBuilder::engineImpl (const string& id, const string& key,
228251 const std::vector<Date>& expiries,
229252 const Date& maturity,
0 commit comments