31 LOG(
"Building CallableSwap " <<
id());
43 instrument_ = QuantLib::ext::make_shared<CompositeInstrumentWrapper>(
72 vector<LegData> legData;
74 for (Size i = 0; i < nodes.size(); i++) {
75 auto ld = QuantLib::ext::make_shared<ore::data::LegData>();
76 ld->fromXML(nodes[i]);
77 legData.push_back(*ld);
84 vector<LegData> reversedLegData(legData);
85 for (
auto& l : reversedLegData)
86 l.isPayer() = !l.isPayer();
Callable Swap data model and serialization.
virtual void fromXML(ore::data::XMLNode *node) override
virtual ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
void build(const QuantLib::ext::shared_ptr< ore::data::EngineFactory > &) override
Build QuantLib/QuantExt instrument, link pricing engine.
ore::data::Swaption swaption_
const std::map< std::string, boost::any > & additionalData() const override
returns all additional data returned by the trade once built
Serializable object holding leg data.
virtual XMLNode * toXML(XMLDocument &doc) const override
Serializable object holding option data.
const string & longShort() const
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
void addData(const RequiredFixings &requiredFixings)
Serializable Swap, Single and Cross Currency.
const vector< LegData > & legData() const
std::string notionalCurrency() const override
QuantLib::Real notional() const override
Return the current notional in npvCurrency. See individual sub-classes for the precise definition.
virtual void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
Build QuantLib/QuantExt instrument, link pricing engine.
const std::map< std::string, boost::any > & additionalData() const override
returns all additional data returned by the trade once built
const OptionData & optionData() const
void build(const QuantLib::ext::shared_ptr< EngineFactory > &) override
const std::string & sensitivityTemplate() const
std::vector< bool > legPayers_
std::vector< string > legCurrencies_
const std::vector< QuantLib::Leg > & legs() const
const Date & maturity() const
std::vector< QuantLib::Leg > legs_
const RequiredFixings & requiredFixings() const
virtual void fromXML(XMLNode *node) override
void setSensitivityTemplate(const EngineBuilder &builder)
virtual XMLNode * toXML(XMLDocument &doc) const override
const std::vector< string > & legCurrencies() const
string & id()
Set the trade id.
const std::vector< bool > & legPayers() const
RequiredFixings requiredFixings_
const QuantLib::ext::shared_ptr< InstrumentWrapper > & instrument() const
const string & npvCurrency() const
const Envelope & envelope() const
QuantLib::ext::shared_ptr< InstrumentWrapper > instrument_
void reset()
Reset trade, clear all base class data. This does not reset accumulated timings for this trade.
Small XML Document wrapper class.
XMLNode * allocNode(const string &nodeName)
util functions that wrap rapidxml
static vector< XMLNode * > getChildrenNodes(XMLNode *node, const string &name)
Returns all the children with a given name.
static XMLNode * getChildNode(XMLNode *n, const string &name="")
static void appendNode(XMLNode *parent, XMLNode *child)
used to store multiple trade wrappers
Position::Type parsePositionType(const std::string &s)
Convert text to QuantLib::Position::Type.
leg data model and serialization
Classes and functions for log message handling.
#define LOG(text)
Logging Macro (Level = Notice)
Size size(const ValueType &v)
Serializable Credit Default Swap.
Wrapper for option instruments, tracks whether option has been exercised or not.
string conversion utilities