56 :
Trade(
"CompositeTrade", env, ta) {
68 virtual void build(
const QuantLib::ext::shared_ptr<EngineFactory>&)
override;
69 QuantLib::Real
notional()
const override;
77 const vector<QuantLib::ext::shared_ptr<Trade>>&
trades()
const {
return trades_; }
97 std::map<std::string, RequiredFixings::FixingDates>
fixings(
const QuantLib::Date& settlementDate)
const override;
98 std::map<AssetClass, std::set<std::string>>
underlyingIndices(
const QuantLib::ext::shared_ptr<ReferenceDataManager>& referenceDataManager)
const override;;
99 const std::map<std::string,boost::any>&
additionalData()
const override;
110 vector<QuantLib::ext::shared_ptr<Trade>>
trades_;
vector< Handle< Quote > > fxRatesNotional_
std::map< std::string, RequiredFixings::FixingDates > fixings(const QuantLib::Date &settlementDate) const override
const string & currency() const
const bool & portfolioBasket() const
Real calculateNotional(const vector< Real > &tradeNotionals) const
calculates the CompositeTrade notional, when supplied with the notionals of the subtrades
const string & portfolioId() const
const vector< QuantLib::ext::shared_ptr< Trade > > & trades() const
void getTradesFromReferenceData(const QuantLib::ext::shared_ptr< PortfolioBasketReferenceDatum > &ptfReferenceDatum)
vector< Handle< Quote > > fxRates_
CompositeTrade(const Envelope &env=Envelope(), const TradeActions &ta=TradeActions())
Constructor requires a trade factory so that subtrades can be built.
QuantLib::Real notional() const override
Return the current notional in npvCurrency. See individual sub-classes for the precise definition.
vector< QuantLib::ext::shared_ptr< Trade > > trades_
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
const string & notionalCalculation() const
NotionalCalculation
This enum decalres how the notional of the CompositeTrade should be calculated.
@ Mean
The notional is calculated as the average of notionals of subtrades.
@ Max
The notional is taken as the maximum subtrade notional.
@ Override
The notional is explicitly overridden.
@ Min
The notional is taken as the minimum subtrade notional.
@ First
The notional is taken as the first subtrade notional.
@ Sum
The notional is calculated as the sum of notionals of subtrades.
@ Last
The notional is taken as the last subtrade notional.
string notionalCalculation_
void populateFromReferenceData(const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceDataManager)
Size size() const
returns the number of subtrades in the strategy
CompositeTrade(const string currency, const vector< QuantLib::ext::shared_ptr< Trade > > &trades, const string notionalCalculation="", const Real notionalOverride=0.0, const Envelope &env=Envelope(), const TradeActions &ta=TradeActions())
Fully-specified Constructor.
std::map< AssetClass, std::set< std::string > > underlyingIndices(const QuantLib::ext::shared_ptr< ReferenceDataManager > &referenceDataManager) const override
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
Serializable object holding generic trade data, reporting dimensions.
Serializable object holding generic trade actions.
void reset()
Reset trade, clear all base class data. This does not reset accumulated timings for this trade.
Small XML Document wrapper class.
Serializable Credit Default Swap.
Reference data model and serialization.
base trade data model and serialization