37 numbers_.emplace_back(
"Number",
"LongShort", position == Position::Long ?
"1" :
"-1");
54 "NUMBER i, terminated, currentNotional;\n"
55 "FOR i IN (1, SIZE(FixingDates), 1) DO\n"
56 " IF terminated == 0 AND Underlying(FixingDates[i]) <= TriggerLevel THEN\n"
57 " Option = LOGPAY( LongShort * NotionalAmount * AccumulationFactors[i], FixingDates[i],\n"
58 " SettlementDates[i], PayCcy);\n"
61 " IF terminated == 0 AND i == SIZE(FixingDates) AND Underlying(FixingDates[i]) > "
62 "DeterminationLevel THEN\n"
63 " Option = LOGPAY( -LongShort * NotionalAmount * min( Cap, Underlying(FixingDates[i]) -\n"
64 " DeterminationLevel ),\n"
65 " FixingDates[i], SettlementDates[i], PayCcy);\n"
68 "Option", {{
"currentNotional",
"NotionalAmount"}, {
"notionalCurrency",
"PayCcy"}}, {})}};
80 std::string assetClass = boost::any_cast<std::string>(
additionalData_[
"isdaAssetClass"]);
81 if (assetClass ==
"Equity") {
83 additionalData_[
"isdaSubProduct"] = string(
"Price Return Basic Performance");
85 else if (assetClass ==
"Commodity") {
88 additionalData_[
"isdaSubProduct"] = string(
"Price Return Basic Performance");
90 else if (assetClass ==
"Foreign Exchange") {
95 WLOG(
"ISDA taxonomy incomplete for trade " <<
id());
105 QL_REQUIRE(tradeDataNode,
"Autocallable01Data node not found");
114 underlyingBuilder.
fromXML(tmp);
autocallable_01 wrapper for scripted trade
ScheduleData settlementDates_
void setIsdaTaxonomyFields() override
ScheduleData fixingDates_
vector< string > accumulationFactors_
void fromXML(XMLNode *node) override
QuantLib::ext::shared_ptr< Underlying > underlying_
XMLNode * toXML(XMLDocument &doc) const override
string determinationLevel_
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
std::vector< ScriptedTradeEventData > events_
std::vector< ScriptedTradeValueTypeData > currencies_
std::vector< ScriptedTradeValueTypeData > indices_
virtual void setIsdaTaxonomyFields()
std::vector< ScriptedTradeValueTypeData > numbers_
std::map< std::string, ScriptedTradeScriptData > script_
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
std::map< std::string, boost::any > additionalData_
const QuantLib::ext::shared_ptr< Underlying > & underlying()
void fromXML(XMLNode *node) override
Small XML Document wrapper class.
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
static void addChildren(XMLDocument &doc, XMLNode *n, const string &names, const string &name, const vector< T > &values)
static string getChildValue(XMLNode *node, const string &name, bool mandatory=false, const string &defaultValue=string())
static XMLNode * getChildNode(XMLNode *n, const string &name="")
static vector< string > getChildrenValues(XMLNode *node, const string &names, const string &name, bool mandatory=false)
static XMLNode * addChild(XMLDocument &doc, XMLNode *n, const string &name)
static void appendNode(XMLNode *parent, XMLNode *child)
Position::Type parsePositionType(const std::string &s)
Convert text to QuantLib::Position::Type.
#define WLOG(text)
Logging Macro (Level = Warning)
QL_DEPRECATED_ENABLE_WARNING std::string scriptedIndexName(const QuantLib::ext::shared_ptr< Underlying > &underlying)
Serializable Credit Default Swap.