36void VarSwap::build(
const QuantLib::ext::shared_ptr<ore::data::EngineFactory>& engineFactory) {
53 additionalData_[
"isdaSubProduct"] = string(
"Parameter Return Variance");
55 additionalData_[
"isdaSubProduct"] = string(
"Parameter Return Volatility");
62 additionalData_[
"isdaSubProduct"] = string(
"Parameter Return Variance");
64 additionalData_[
"isdaSubProduct"] = string(
"Parameter Return Volatility");
66 WLOG(
"ISDA taxonomy not set for trade " <<
id());
76 "VarSwap::build() strike must be positive (" <<
strike_ <<
")");
78 "VarSwap::build() notional must be non-negative (" <<
notional_ <<
")");
90 QuantLib::ext::shared_ptr<ore::data::EngineBuilder> builder = engineFactory->builder(
tradeType_);
91 QL_REQUIRE(builder,
"No builder found for " <<
tradeType_);
92 QuantLib::ext::shared_ptr<VarSwapEngineBuilder> varSwapBuilder = QuantLib::ext::dynamic_pointer_cast<VarSwapEngineBuilder>(builder);
114 return varianceNotional * 10000;
133 QL_REQUIRE(tmp,
"Must provide a valid Underlying or Name node");
136 underlyingBuilder.
fromXML(tmp);
147 if (addPastDividendsStr ==
"")
158 vNode = doc.
allocNode(
"VarianceSwapData");
188std::map<AssetClass, std::set<std::string>>
193std::map<AssetClass, std::set<std::string>>
std::map< AssetClass, std::set< std::string > > underlyingIndices(const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceDataManager=nullptr) const override
Add underlying Equity names.
std::map< AssetClass, std::set< std::string > > underlyingIndices(const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceDataManager=nullptr) const override
Add underlying Equity names.
void addFixingDate(const QuantLib::Date &fixingDate, const std::string &indexName, const QuantLib::Date &payDate=Date::maxDate(), const bool alwaysAddIfPaysOnSettlement=false, const bool mandatoryFixing=true)
virtual void fromXML(XMLNode *node) override
void setSensitivityTemplate(const EngineBuilder &builder)
virtual XMLNode * toXML(XMLDocument &doc) const override
RequiredFixings requiredFixings_
QuantLib::ext::shared_ptr< InstrumentWrapper > instrument_
const string & tradeType() const
std::map< std::string, boost::any > additionalData_
const QuantLib::ext::shared_ptr< Underlying > & underlying()
void fromXML(XMLNode *node) override
Vanilla Instrument Wrapper.
QuantLib::ext::shared_ptr< ore::data::Underlying > underlying_
const std::string & name() const
AssetClass assetClassUnderlying_
double notional() const override
Return the current notional in npvCurrency. See individual sub-classes for the precise definition.
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(ore::data::XMLDocument &doc) const override
void build(const QuantLib::ext::shared_ptr< ore::data::EngineFactory > &) override
const string & momentType()
const string & longShort()
Small XML Document wrapper class.
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
static Real getChildValueAsDouble(XMLNode *node, const string &name, bool mandatory=false, double defaultValue=0.0)
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
static XMLNode * getChildNode(XMLNode *n, const string &name="")
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
static void appendNode(XMLNode *parent, XMLNode *child)
Calendar parseCalendar(const string &s)
Convert text to QuantLib::Calendar.
Date parseDate(const string &s)
Convert std::string to QuantLib::Date.
Currency parseCurrency(const string &s)
Convert text to QuantLib::Currency.
Position::Type parsePositionType(const std::string &s)
Convert text to QuantLib::Position::Type.
bool parseBool(const string &s)
Convert text to bool.
MomentType parseMomentType(const std::string &s)
Convert text to ore::data::MomentType.
#define WLOG(text)
Logging Macro (Level = Warning)
Filter close_enough(const RandomVariable &x, const RandomVariable &y)
Serializable Credit Default Swap.
Map text representations to QuantLib/QuantExt types.
Reference data model and serialization.
variance swap representation