Skip to content

Commit 080a26a

Browse files
rolandlichtersjenkins
authored andcommitted
Merge remote-tracking branch 'origin/master' into 1.0.66_to_master
1 parent b94ea64 commit 080a26a

6 files changed

Lines changed: 12 additions & 4 deletions

File tree

OREAnalytics/orea/app/inputparameters.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ class InputParameters {
460460
std::string baseCurrency_;
461461
bool continueOnError_ = true;
462462
bool lazyMarketBuilding_ = true;
463-
bool buildFailedTrades_ = false;
463+
bool buildFailedTrades_ = true;
464464
std::string observationModel_ = "None";
465465
bool implyTodaysFixings_ = false;
466466
std::map<std::string, std::string> marketConfigs_;

OREAnalytics/orea/app/marketdataloader.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ void MarketDataLoader::populateFixings(
189189
if (inputs_->eomInflationFixings()) {
190190
LOG("Adjust inflation fixing dates to the end of the month before the request");
191191
amendInflationFixingDates(fixings_);
192+
amendInflationFixingDates(portfolioFixings_);
192193
}
193194

194195
if (fixings_.size() > 0)

OREAnalytics/orea/app/oreapp.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,7 @@ void OREApp::buildInputParameters(boost::shared_ptr<InputParameters> inputs,
587587
inputs->setAllFixings(true);
588588
inputs->setEomInflationFixings(false);
589589
inputs->setUseMarketDataFixings(false);
590+
inputs->setBuildFailedTrades(false);
590591

591592
QL_REQUIRE(params_->hasGroup("setup"), "parameter group 'setup' missing");
592593

OREData/ored/marketdata/defaultcurve.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ DefaultCurve::DefaultCurve(Date asof, DefaultCurveSpec spec, const Loader& loade
284284
<< " was not recognised");
285285
}
286286
built = true;
287+
break;
287288
} catch (exception& e) {
288289
std::ostringstream message;
289290
message << "build attempt failed for " << configs->curveID() << " using config with priority "

OREData/ored/portfolio/commodityoptionstrip.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ void CommodityOptionStrip::buildAPOs(const Leg& leg, const boost::shared_ptr<Eng
304304
QL_REQUIRE(undCcy.code() == legData_.currency(),
305305
"Strips of commodity digital options do not support intra-currency trades yet.");
306306
commOption = boost::make_shared<CommodityDigitalAveragePriceOption>(
307-
envelope(), optionData, tempDatum.strike, cf->periodQuantity() * payoffPerUnit(),
307+
envelope(), optionData, tempDatum.strike, cf->quantity() * payoffPerUnit(),
308308
legData_.currency(), commLegData_->name(), commLegData_->priceType(), to_string(start),
309309
to_string(cf->endDate()), legData_.paymentCalendar(), legData_.paymentLag(),
310310
legData_.paymentConvention(), commLegData_->pricingCalendar(), to_string(cf->date()),

QuantExt/qle/pricingengines/commodityspreadoptionengine.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ void CommoditySpreadOptionAnalyticalEngine::calculate() const {
8888
double stdDev = 0;
8989
double Y = 0;
9090
double Z = 0;
91+
double sigmaY = 0;
9192
double w1 = arguments_.longAssetFlow->gearing();
9293
double w2 = arguments_.shortAssetFlow->gearing();
9394
// Adjust strike for past fixings
@@ -117,9 +118,9 @@ void CommoditySpreadOptionAnalyticalEngine::calculate() const {
117118
// KirkFormula
118119
Y = (F2 * w2 + effectiveStrike);
119120
Z = w1 * F1 / Y;
120-
double sigmaTilde = sigma2 * F2 * w2 / Y;
121+
sigmaY = sigma2 * F2 * w2 / Y;
121122

122-
sigma = std::sqrt(std::pow(sigma1, 2.0) + std::pow(sigmaTilde, 2.0) - 2 * sigma1 * sigmaTilde * rho());
123+
sigma = std::sqrt(std::pow(sigma1, 2.0) + std::pow(sigmaY, 2.0) - 2 * sigma1 * sigmaY * rho());
123124

124125
stdDev = sigma * sqrt(tte);
125126

@@ -142,10 +143,14 @@ void CommoditySpreadOptionAnalyticalEngine::calculate() const {
142143
mp["stdDev"] = stdDev;
143144
mp["Y"] = Y;
144145
mp["Z"] = Z;
146+
mp["sigma_Y"] = sigmaY;
145147
mp["quantity"] = arguments_.quantity;
146148
mp["npv"] = results_.value;
147149
mp["exerciseDate"] = exerciseDate;
148150
mp["paymentDate"] = paymentDate;
151+
mp["w1"] = w1;
152+
mp["w2"] = w2;
153+
mp["rho"] = rho();
149154
}
150155

151156
CommoditySpreadOptionAnalyticalEngine::PricingParameter

0 commit comments

Comments
 (0)