26 const ext::shared_ptr<SwapIndex>& swapIndex1,
27 ext::shared_ptr<SwapIndex> swapIndex2,
32 swapIndex1->fixingDays(),
33 swapIndex1->currency(),
34 swapIndex1->fixingCalendar(),
35 swapIndex1->dayCounter()),
36 swapIndex1_(swapIndex1), swapIndex2_(
std::move(swapIndex2)), gearing1_(gearing1),
42 std::ostringstream
name;
43 name << std::setprecision(4) << std::fixed <<
swapIndex1_->name() <<
"("
49 "index1 fixing days ("
51 <<
"must be equal to index2 fixing days ("
56 "index1 fixingCalendar ("
58 <<
"must be equal to index2 fixingCalendar ("
62 "index1 currency (" <<
swapIndex1_->currency() <<
")"
63 <<
"must be equal to index2 currency ("
69 <<
"must be equal to index2 dayCounter ("
73 "index1 fixedLegTenor ("
75 <<
"must be equal to index2 fixedLegTenor ("
80 "index1 fixedLegConvention ("
82 <<
"must be equal to index2 fixedLegConvention ("
base class for interest rate indexes
std::string name() const override
Returns the name of the index.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
ext::shared_ptr< SwapIndex > swapIndex2_
SwapSpreadIndex(const std::string &familyName, const ext::shared_ptr< SwapIndex > &swapIndex1, ext::shared_ptr< SwapIndex > swapIndex2, Real gearing1=1.0, Real gearing2=-1.0)
ext::shared_ptr< SwapIndex > swapIndex1_
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified