Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
AverageFXLinked Class Referenceabstract

#include <qle/cashflows/fxlinkedcashflow.hpp>

+ Inheritance diagram for AverageFXLinked:
+ Collaboration diagram for AverageFXLinked:

Public Member Functions

 AverageFXLinked (const std::vector< Date > &fixingDates, Real foreignAmount, QuantLib::ext::shared_ptr< FxIndex > fxIndex, const bool inverted=false)
 
virtual ~AverageFXLinked ()
 
const std::vector< Date > & fxFixingDates () const
 
Real foreignAmount () const
 
const QuantLib::ext::shared_ptr< FxIndex > & fxIndex () const
 
Real fxRate () const
 
virtual QuantLib::ext::shared_ptr< AverageFXLinkedclone (QuantLib::ext::shared_ptr< FxIndex > fxIndex)=0
 

Protected Attributes

std::vector< Date > fxFixingDates_
 
Real foreignAmount_
 
QuantLib::ext::shared_ptr< FxIndexfxIndex_
 
bool inverted_ = false
 

Detailed Description

Definition at line 56 of file fxlinkedcashflow.hpp.

Constructor & Destructor Documentation

◆ AverageFXLinked()

AverageFXLinked ( const std::vector< Date > &  fixingDates,
Real  foreignAmount,
QuantLib::ext::shared_ptr< FxIndex fxIndex,
const bool  inverted = false 
)

Definition at line 27 of file fxlinkedcashflow.cpp.

std::vector< Date > fxFixingDates_
QuantLib::ext::shared_ptr< FxIndex > fxIndex_
const QuantLib::ext::shared_ptr< FxIndex > & fxIndex() const
const std::vector< Date > & fxFixingDates() const

◆ ~AverageFXLinked()

virtual ~AverageFXLinked ( )
virtual

Definition at line 62 of file fxlinkedcashflow.hpp.

62{}

Member Function Documentation

◆ fxFixingDates()

const std::vector< Date > & fxFixingDates ( ) const

Definition at line 63 of file fxlinkedcashflow.hpp.

63{ return fxFixingDates_; }
+ Here is the caller graph for this function:

◆ foreignAmount()

Real foreignAmount ( ) const

Definition at line 64 of file fxlinkedcashflow.hpp.

64{ return foreignAmount_; }
+ Here is the caller graph for this function:

◆ fxIndex()

const QuantLib::ext::shared_ptr< FxIndex > & fxIndex ( ) const

Definition at line 65 of file fxlinkedcashflow.hpp.

65{ return fxIndex_; }
+ Here is the caller graph for this function:

◆ fxRate()

Real fxRate ( ) const

Definition at line 35 of file fxlinkedcashflow.cpp.

35 {
36 Real fx = 0;
37 for (auto const& d: fxFixingDates_)
38 fx += inverted_ ? 1.0 / fxIndex_->fixing(d) : fxIndex_->fixing(d);
39 fx /= fxFixingDates_.size();
40 return inverted_ ? 1.0 / fx : fx;
41}
+ Here is the caller graph for this function:

◆ clone()

virtual QuantLib::ext::shared_ptr< AverageFXLinked > clone ( QuantLib::ext::shared_ptr< FxIndex fxIndex)
pure virtual

Implemented in AverageFXLinkedCashFlow.

Member Data Documentation

◆ fxFixingDates_

std::vector<Date> fxFixingDates_
protected

Definition at line 71 of file fxlinkedcashflow.hpp.

◆ foreignAmount_

Real foreignAmount_
protected

Definition at line 72 of file fxlinkedcashflow.hpp.

◆ fxIndex_

QuantLib::ext::shared_ptr<FxIndex> fxIndex_
protected

Definition at line 73 of file fxlinkedcashflow.hpp.

◆ inverted_

bool inverted_ = false
protected

Definition at line 74 of file fxlinkedcashflow.hpp.