@@ -47,15 +47,15 @@ void EquityOption::build(const boost::shared_ptr<EngineFactory>& engineFactory)
4747
4848 // check the equity currency
4949 underlyingCurrency_ =
50- market->equityCurve (assetName_, engineFactory->configuration (MarketContext::pricing))->currency (). code () ;
50+ market->equityCurve (assetName_, engineFactory->configuration (MarketContext::pricing))->currency ();
5151 QL_REQUIRE (!underlyingCurrency_.empty (), " No equity currency in equityCurve for equity " << assetName_ << " ." );
5252
5353 // Set the strike currency - if we have a minor currency, convert the strike
5454 if (!strikeCurrency_.empty ())
5555 strike_.setCurrency (strikeCurrency_);
5656 else if (strike_.currency ().empty ()) {
5757 // If payoff currency and underlying currency are equivalent (and payoff currency could be a minor currency)
58- if (ccy == parseCurrency ( underlyingCurrency_) ) {
58+ if (ccy == underlyingCurrency_) {
5959 TLOG (" Setting strike currency to payoff currency " << ccy << " for trade " << id () << " ." );
6060 strike_.setCurrency (ccy.code ());
6161 } else {
@@ -67,15 +67,15 @@ void EquityOption::build(const boost::shared_ptr<EngineFactory>& engineFactory)
6767
6868 // Quanto payoff condition, i.e. currency_ != underlyingCurrency_, will be checked in VanillaOptionTrade::build()
6969 // Build the trade using the shared functionality in the base class.
70- if (strike_.currency () != underlyingCurrency_) {
70+ if (strike_.currency () != underlyingCurrency_. code () ) {
7171
7272 // We have a composite EQ Trade
7373
7474 Currency strikeCcy = parseCurrencyWithMinors (strikeCurrency_);
7575 QL_REQUIRE (ccy == strikeCcy, " Equity composite option requires pay ccy ("
7676 << ccy.code () << " ) to match strike ccy (" << strikeCcy.code ()
7777 << " ), quanto composite options are not supported (underlying currency is "
78- << underlyingCurrency_ << " )" );
78+ << underlyingCurrency_. code () << " )" );
7979
8080 Option::Type type = parseOptionType (option_.callPut ());
8181 boost::shared_ptr<StrikedTypePayoff> payoff (new PlainVanillaPayoff (type, strike_.value ()));
@@ -133,7 +133,7 @@ void EquityOption::build(const boost::shared_ptr<EngineFactory>& engineFactory)
133133 // TODO cast and set pricing engine
134134
135135 auto compositeBuilder = boost::dynamic_pointer_cast<EquityEuropeanCompositeEngineBuilder>(builder);
136- vanilla->setPricingEngine (compositeBuilder->engine (assetName_, parseCurrency ( underlyingCurrency_) ,
136+ vanilla->setPricingEngine (compositeBuilder->engine (assetName_, underlyingCurrency_,
137137 parseCurrency (strike_.currency ()), expiryDate_));
138138
139139 string configuration = Market::defaultConfiguration;
0 commit comments