QuantLib_CompositeInstrument man page

CompositeInstrument — Composite instrument  


#include <ql/instruments/compositeinstrument.hpp>

Inherits Instrument.

Public Member Functions

void add (const boost::shared_ptr< Instrument > &instrument, Real multiplier=1.0)
adds an instrument to the composite
void subtract (const boost::shared_ptr< Instrument > &instrument, Real multiplier=1.0)
shorts an instrument from the composite

Observer interface

void deepUpdate ()

Instrument interface

bool isExpired () const
returns whether the instrument might have value greater than zero.
void performCalculations () const

Additional Inherited Members

Detailed Description

Composite instrument

This instrument is an aggregate of other instruments. Its NPV is the sum of the NPVs of its components, each possibly multiplied by a given factor.

Example: static replication of a down-and-out barrier option


Methods that drive the calculation directly (such as recalculate(), freeze() and others) might not work correctly.

Examples: Replication.cpp.

Member Function Documentation

void deepUpdate () [virtual]

This method allows to explicitly update the instance itself and nested observers. If notifications are disabled a call to this method ensures an update of such nested observers. It should be implemented in derived classes whenever applicable

Reimplemented from Observer.

void performCalculations () const [protected], [virtual]

In case a pricing engine is not used, this method must be overridden to perform the actual calculations and set any needed results. In case a pricing engine is used, the default implementation can be used.

Reimplemented from Instrument.


Generated automatically by Doxygen for QuantLib from the source code.

Referenced By

The man pages deepUpdate(3) and subtract(3) are aliases of QuantLib_CompositeInstrument(3).

Mon Apr 30 2018 Version 1.12.1 QuantLib