Skip to content

Commit 2de6d74

Browse files
merge master
2 parents ba837f1 + 915169f commit 2de6d74

22 files changed

Lines changed: 86 additions & 56 deletions

Docs/UserGuide/tradedata/fxforward.tex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ \subsubsection{FX Average Forward}
9797
<ReferenceCurrency>EUR</ReferenceCurrency>
9898
<SettlementNotional>10000</SettlementNotional>
9999
<SettlementCurrency>USD</SettlementCurrency>
100-
<Currency>USD</Currency>
101100
<FXIndex>FX-ECB-EUR-USD</FXIndex>
102101
<Settlement>Cash</Settlement>
103102
</FxAverageForwardData>

Docs/UserGuide/userguide.tex

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ \subsubsection*{Generate Visual Studio Projects with CMake}
699699
\item Open a Visual Studio Tools Command Prompt
700700
\begin{itemize}
701701
\item 32-bit: VS2022/x86 Native Tools Command Prompt for VS 2022
702-
\item 64-bit: VS2022/x64 Native Tools Command Prompt for VS 2022
702+
\item 64-bit: VS2022/x64 Native Tools Command Prompt for VS 2022
703703
\end{itemize}
704704
\item Navigate to the ORE root directory
705705
\item Run CMake command:
@@ -718,6 +718,19 @@ \subsubsection*{Generate Visual Studio Projects with CMake}
718718
\item or open the MSVC solution file {\tt build{\bs}ORE.sln} and build the entire solution with Visual Studio (again, make sure to select the correct platform in the configuration manager first).
719719
\end{enumerate}
720720

721+
\subsubsection*{Use Visual Studio's CMake capabilities}
722+
723+
Alternatively, from Visual Studio 2015 onward, you can use Visual Studios capability to parse the CMakeLists.txt in the ORE root directory, by first setting the CMake BOOST variables in the environment:
724+
725+
{\tt set BOOST_INCLUDE_DIR=} pointing to your boost directory, e.g {\tt C:{\bs}boost\_1\_72\_0}
726+
{\tt set BOOST_LIBRARYDIR=} pointing to your Win32 or x64 boost lib directory, e.g {\tt C:{\bs}boost\_1\_72\_0{\bs}lib32\-msvc\-14.0} or {\tt C:{\bs}boost\_1\_72\_0{\bs}lib64\-msvc\-14.0}
727+
{\tt set BOOST_ROOT=} pointing to your boost directory, e.g {\tt C:{\bs}boost\_1\_72\_0}
728+
729+
Afterwards, start the development environment, e.g {\tt "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe"} and open the CMakeLists.txt file using File, Menu, CMake...
730+
Once the file has been parsed successfully and CMake generation has been finished (observable in the output window), you can switch in the solution explorer from the file view to the projects view, where the CMake Targets View can be selected. In this view, the various target projects can be seen below "ORE Project" and be used in a similar manner as the usual VS projects.
731+
732+
The executables are built in the subfolder {\tt /build/TARGET/CONFIGURATION/EXECUTABLE}, e.g. {\tt /build/App/Release/ore.exe}, the debug and launch settings are set in launch.vs.json and not in the GUI.
733+
721734
\subsubsection*{Unix}
722735

723736
With the 5th release we have discontinued automake support so that ORE can only be built with CMake on Unix systems, as follows.

OREData/ored/marketdata/commodityvolcurve.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ CommodityVolCurve::CommodityVolCurve(const Date& asof, const CommodityVolatility
190190
dayCounter_ = parseDayCounter(config.dayCounter());
191191

192192
// loop over the volatility configs attempting to build in the order provided
193-
DLOG("CommodityVolCurve: Attempting to build equity vol curve from volatilityConfig, "
193+
DLOG("CommodityVolCurve: Attempting to build commodity vol curve from volatilityConfig, "
194194
<< config.volatilityConfig().size() << " volatility configs provided.");
195195
for (auto vc : config.volatilityConfig()) {
196196
try {
@@ -266,9 +266,9 @@ CommodityVolCurve::CommodityVolCurve(const Date& asof, const CommodityVolatility
266266
if (buildCalibrationInfo)
267267
this->buildVolCalibrationInfo(asof, vc, curveConfigs, config);
268268
} catch (std::exception& e) {
269-
DLOG("CommodityVolCurve: equity vol curve building failed :" << e.what());
269+
DLOG("CommodityVolCurve: commodity vol curve building failed :" << e.what());
270270
} catch (...) {
271-
DLOG("CommodityVolCurve: equity vol curve building failed: unknown error");
271+
DLOG("CommodityVolCurve: commodity vol curve building failed: unknown error");
272272
}
273273
}
274274
QL_REQUIRE(volatility_ , "CommodityVolCurve: Failed to build commodity volatility structure from "
@@ -339,7 +339,7 @@ void CommodityVolCurve::buildVolatility(const QuantLib::Date& asof, const Commod
339339
if (!q)
340340
continue;
341341
QL_REQUIRE(q->quoteType() == vcc.quoteType(),
342-
"EquityOptionQuote type '" << q->quoteType() << "' <> VolatilityCurveConfig quote type '" << vcc.quoteType() << "'");
342+
"CommodityOptionQuote type '" << q->quoteType() << "' <> VolatilityCurveConfig quote type '" << vcc.quoteType() << "'");
343343

344344
TLOG("The quote " << q->name() << " matched the pattern");
345345

OREData/ored/portfolio/asianoption.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,16 +182,15 @@ void AsianOption::build(const boost::shared_ptr<EngineFactory>& engineFactory) {
182182
notionalCurrency_ = currency_;
183183

184184
// ISDA taxonomy
185-
if (underlying_->type() == "EQ") {
185+
if (underlying_->type() == "Equity") {
186186
additionalData_["isdaAssetClass"] = string("Equity");
187187
additionalData_["isdaBaseProduct"] = string("Option");
188188
additionalData_["isdaSubProduct"] = string("Price Return Basic Performance");
189189
} else if (underlying_->type() == "FX") {
190190
additionalData_["isdaAssetClass"] = string("Foreign Exchange");
191191
additionalData_["isdaBaseProduct"] = string("Vanilla Option");
192192
additionalData_["isdaSubProduct"] = string("");
193-
194-
} else if (underlying_->type() == "COM") {
193+
} else if (underlying_->type() == "Commodity") {
195194
// guessing that Commodities are treated like Equity
196195
additionalData_["isdaAssetClass"] = string("Commodity");
197196
additionalData_["isdaBaseProduct"] = string("Option");

OREData/ored/portfolio/builders/cdo.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <qle/pricingengines/midpointcdoengine.hpp>
2727

2828
// avoid compile error from homogeneouspooldef.hpp
29-
#include <boost/bind.hpp>
3029
#include <boost/algorithm/string.hpp>
3130

3231
#include <qle/models/homogeneouspooldef.hpp>

OREData/ored/portfolio/cliquetoption.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ void CliquetOption::build(const boost::shared_ptr<EngineFactory>& engineFactory)
9595
additionalData_["currency"] = currency_;
9696

9797
// ISDA taxonomy
98-
if (underlying_->type() == "EQ") {
98+
if (underlying_->type() == "Equity") {
9999
additionalData_["isdaAssetClass"] = string("Equity");
100100
additionalData_["isdaBaseProduct"] = string("Other");
101101
additionalData_["isdaSubProduct"] = string("Price Return Basic Performance");
102102
}
103-
else if (underlying_->type() == "COM") {
103+
else if (underlying_->type() == "Commodity") {
104104
// assuming that Commoditiy is treated like Equity
105105
additionalData_["isdaAssetClass"] = string("Commodity");
106106
additionalData_["isdaBaseProduct"] = string("Other");

OREData/ored/portfolio/equityswap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void EquitySwap::checkEquitySwap(const vector<LegData>& legData) {
3737
for (Size i = 0; i < legData.size(); ++i) {
3838
if (legData[i].legType() == "Equity") {
3939
equityLegIndex_ = i;
40-
} else if (legData[i].legType() == "Fixed" || legData[i].legType() == "Floating") {
40+
} else {
4141
irLegIndex_ = i;
4242
}
4343
}

OREData/ored/utilities/currencyparser.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -167,25 +167,25 @@ void CurrencyParser::reset() {
167167

168168
currencies_ = {{"AED", AEDCurrency()}, {"AOA", AOACurrency()}, {"ARS", ARSCurrency()}, {"ATS", ATSCurrency()},
169169
{"AUD", AUDCurrency()}, {"BEF", BEFCurrency()}, {"BGN", BGNCurrency()}, {"BHD", BHDCurrency()},
170-
{"BRL", BRLCurrency()}, {"CAD", CADCurrency()}, {"CHF", CHFCurrency()}, {"CLF", CLFCurrency()},
171-
{"CLP", CLPCurrency()}, {"CNH", CNHCurrency()}, {"CNY", CNYCurrency()}, {"COP", COPCurrency()},
172-
{"COU", COUCurrency()}, {"CZK", CZKCurrency()}, {"DEM", DEMCurrency()}, {"DKK", DKKCurrency()},
173-
{"EGP", EGPCurrency()}, {"ESP", ESPCurrency()}, {"ETB", ETBCurrency()}, {"EUR", EURCurrency()},
174-
{"FIM", FIMCurrency()}, {"FRF", FRFCurrency()}, {"GBP", GBPCurrency()}, {"GEL", GELCurrency()},
175-
{"GHS", GHSCurrency()}, {"GRD", GRDCurrency()}, {"HKD", HKDCurrency()}, {"HRK", HRKCurrency()},
176-
{"HUF", HUFCurrency()}, {"IDR", IDRCurrency()}, {"IEP", IEPCurrency()}, {"ILS", ILSCurrency()},
177-
{"INR", INRCurrency()}, {"ISK", ISKCurrency()}, {"ITL", ITLCurrency()}, {"JOD", JODCurrency()},
178-
{"JPY", JPYCurrency()}, {"KES", KESCurrency()}, {"KRW", KRWCurrency()}, {"KWD", KWDCurrency()},
179-
{"KZT", KZTCurrency()}, {"LKR", LKRCurrency()}, {"LUF", LUFCurrency()}, {"MAD", MADCurrency()},
180-
{"MUR", MURCurrency()}, {"MXN", MXNCurrency()}, {"MXV", MXVCurrency()}, {"MYR", MYRCurrency()},
181-
{"NGN", NGNCurrency()}, {"NLG", NLGCurrency()}, {"NOK", NOKCurrency()}, {"NZD", NZDCurrency()},
182-
{"OMR", OMRCurrency()}, {"PEN", PENCurrency()}, {"PHP", PHPCurrency()}, {"PKR", PKRCurrency()},
183-
{"PLN", PLNCurrency()}, {"PTE", PTECurrency()}, {"QAR", QARCurrency()}, {"RON", RONCurrency()},
184-
{"RSD", RSDCurrency()}, {"RUB", RUBCurrency()}, {"SAR", SARCurrency()}, {"SEK", SEKCurrency()},
185-
{"SGD", SGDCurrency()}, {"THB", THBCurrency()}, {"TND", TNDCurrency()}, {"TRY", TRYCurrency()},
186-
{"TWD", TWDCurrency()}, {"UAH", UAHCurrency()}, {"UGX", UGXCurrency()}, {"USD", USDCurrency()},
187-
{"UYU", UYUCurrency()}, {"VND", VNDCurrency()}, {"XOF", XOFCurrency()}, {"ZAR", ZARCurrency()},
188-
{"ZMW", ZMWCurrency()}};
170+
{"BRL", BRLCurrency()}, {"BWP", BWPCurrency()}, {"CAD", CADCurrency()}, {"CHF", CHFCurrency()},
171+
{"CLF", CLFCurrency()}, {"CLP", CLPCurrency()}, {"CNH", CNHCurrency()}, {"CNY", CNYCurrency()},
172+
{"COP", COPCurrency()}, {"COU", COUCurrency()}, {"CZK", CZKCurrency()}, {"DEM", DEMCurrency()},
173+
{"DKK", DKKCurrency()}, {"EGP", EGPCurrency()}, {"ESP", ESPCurrency()}, {"ETB", ETBCurrency()},
174+
{"EUR", EURCurrency()}, {"FIM", FIMCurrency()}, {"FRF", FRFCurrency()}, {"GBP", GBPCurrency()},
175+
{"GEL", GELCurrency()}, {"GHS", GHSCurrency()}, {"GRD", GRDCurrency()}, {"HKD", HKDCurrency()},
176+
{"HRK", HRKCurrency()}, {"HUF", HUFCurrency()}, {"IDR", IDRCurrency()}, {"IEP", IEPCurrency()},
177+
{"ILS", ILSCurrency()}, {"INR", INRCurrency()}, {"ISK", ISKCurrency()}, {"ITL", ITLCurrency()},
178+
{"JOD", JODCurrency()}, {"JPY", JPYCurrency()}, {"KES", KESCurrency()}, {"KRW", KRWCurrency()},
179+
{"KWD", KWDCurrency()}, {"KZT", KZTCurrency()}, {"LKR", LKRCurrency()}, {"LUF", LUFCurrency()},
180+
{"MAD", MADCurrency()}, {"MUR", MURCurrency()}, {"MXN", MXNCurrency()}, {"MXV", MXVCurrency()},
181+
{"MYR", MYRCurrency()}, {"NGN", NGNCurrency()}, {"NLG", NLGCurrency()}, {"NOK", NOKCurrency()},
182+
{"NZD", NZDCurrency()}, {"OMR", OMRCurrency()}, {"PEN", PENCurrency()}, {"PHP", PHPCurrency()},
183+
{"PKR", PKRCurrency()}, {"PLN", PLNCurrency()}, {"PTE", PTECurrency()}, {"QAR", QARCurrency()},
184+
{"RON", RONCurrency()}, {"RSD", RSDCurrency()}, {"RUB", RUBCurrency()}, {"SAR", SARCurrency()},
185+
{"SEK", SEKCurrency()}, {"SGD", SGDCurrency()}, {"THB", THBCurrency()}, {"TND", TNDCurrency()},
186+
{"TRY", TRYCurrency()}, {"TWD", TWDCurrency()}, {"UAH", UAHCurrency()}, {"UGX", UGXCurrency()},
187+
{"USD", USDCurrency()}, {"UYU", UYUCurrency()}, {"VND", VNDCurrency()}, {"XOF", XOFCurrency()},
188+
{"ZAR", ZARCurrency()}, {"ZMW", ZMWCurrency()}};
189189

190190
minorCurrencies_ = {{"GBp", GBPCurrency()}, {"GBX", GBPCurrency()}, {"ILa", ILSCurrency()}, {"ILX", ILSCurrency()},
191191
{"KWf", KWDCurrency()}, {"ZAc", ZARCurrency()}, {"ZAC", ZARCurrency()}, {"ZAX", ZARCurrency()}};

OREData/ored/utilities/parsers.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,10 @@ pair<string, string> parseBoostAny(const boost::any& anyType, Size precision) {
898898
std::ostringstream tmp;
899899
tmp << std::setprecision(precision) << r;
900900
oss << std::fixed << std::regex_replace(tmp.str(), pattern, std::string(""));
901+
} else if (anyType.type() == typeid(QuantLib::Array)) {
902+
resultType = "array";
903+
QuantLib::Array r = boost::any_cast<QuantLib::Array>(anyType);
904+
oss << std::fixed << std::setprecision(precision) << r;
901905
} else {
902906
ALOG("Unsupported Boost::Any type");
903907
resultType = "unsupported_type";

OREData/test/parser.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
Copyright (C) 2016 Quaternion Risk Management Ltd
3+
Copyright (C) 2023 Skandinaviska Enskilda Banken AB (publ)
34
All rights reserved.
45
56
This file is part of ORE, a free-software/open-source library
@@ -1089,6 +1090,19 @@ BOOST_AUTO_TEST_CASE(testJointCalendar) {
10891090
checkCalendars(expectedHolidays, hol);
10901091
}
10911092

1093+
BOOST_AUTO_TEST_CASE(testParseBoostAny) {
1094+
1095+
BOOST_TEST_MESSAGE("Testing parsing of Boost::Any...");
1096+
1097+
// For QuantLib::Array
1098+
Array arr(5, 3);
1099+
boost::any any_array = boost::any_cast<Array>(arr);
1100+
std::pair<std::string, std::string> result;
1101+
BOOST_REQUIRE_NO_THROW(result = ore::data::parseBoostAny(any_array, 0));
1102+
BOOST_CHECK_EQUAL(result.first, "array");
1103+
BOOST_CHECK_EQUAL(result.second, "[ 3; 3; 3; 3; 3 ]");
1104+
}
1105+
10921106
BOOST_AUTO_TEST_SUITE_END()
10931107

10941108
BOOST_AUTO_TEST_SUITE_END()

0 commit comments

Comments
 (0)