Skip to content

Commit 65333c6

Browse files
committed
Merge branch 'master' into 'master'
update from master Closes QPR-12253 See merge request qs/oreswig-github!7
2 parents f1fea8b + 2e7fd3f commit 65333c6

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

OREAnalytics-SWIG/Python/test/test_instruments.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,10 @@ def setUp(self):
338338
self.LIBOR_index = USDLibor(Period(3, Months), self.LIBOR_term_structure)
339339
self.OIS_spread = 0.005
340340
self.LIBOR_spread = 0.0
341+
self.spreadOnShort = True
341342
self.swap = OvernightIndexedBasisSwap(self.type, self.nominal, self.schedule,
342343
self.OIS_index, self.schedule, self.LIBOR_index,
343-
self.OIS_spread, self.LIBOR_spread)
344+
self.spreadOnShort, self.OIS_spread, self.LIBOR_spread)
344345
self.engine = DiscountingSwapEngine(self.OIS_term_structure)
345346
self.swap.setPricingEngine(self.engine)
346347

@@ -362,13 +363,13 @@ def testConsistency(self):
362363
fair_OIS_spread = self.swap.fairOvernightSpread()
363364
swap = OvernightIndexedBasisSwap(self.type, self.nominal, self.schedule,
364365
self.OIS_index, self.schedule, self.LIBOR_index,
365-
fair_OIS_spread, self.LIBOR_spread)
366+
self.spreadOnShort, fair_OIS_spread, self.LIBOR_spread)
366367
swap.setPricingEngine(self.engine)
367368
self.assertFalse(abs(swap.NPV()) > tolerance)
368369
fair_LIBOR_spread = self.swap.fairIborSpread()
369370
swap = OvernightIndexedBasisSwap(self.type, self.nominal, self.schedule,
370371
self.OIS_index, self.schedule, self.LIBOR_index,
371-
self.OIS_spread, fair_LIBOR_spread)
372+
self.spreadOnShort, self.OIS_spread, fair_LIBOR_spread)
372373
swap.setPricingEngine(self.engine)
373374
self.assertFalse(abs(swap.NPV()) > tolerance)
374375

@@ -650,6 +651,7 @@ def setUp(self):
650651
self.date_generation = DateGeneration.Forward
651652
self.end_of_month = False
652653
self.include_spread = False
654+
self.spreadOnShort = True
653655
self.sub_periods_type = SubPeriodsCoupon1.Compounding
654656
self.ois_term_structure = RelinkableYieldTermStructureHandle()
655657
self.short_index_term_structure = RelinkableYieldTermStructureHandle()
@@ -668,7 +670,7 @@ def setUp(self):
668670
self.long_index, self.long_index_leg_spread,
669671
self.short_index_schedule, self.short_index,
670672
self.short_index_leg_spread, self.include_spread,
671-
self.sub_periods_type)
673+
self.spreadOnShort, self.sub_periods_type)
672674
self.short_index_flat_forward = FlatForward(self.todays_date, 0.02, self.short_index.dayCounter())
673675
self.long_index_flat_forward = FlatForward(self.todays_date, 0.03, self.long_index.dayCounter())
674676
self.ois_flat_forward = FlatForward(self.todays_date, 0.01, self.day_counter)
@@ -703,7 +705,7 @@ def testConsistency(self):
703705
self.long_index, self.long_index_leg_spread,
704706
self.short_index_schedule, self.short_index,
705707
fair_short_leg_spread, self.include_spread,
706-
self.sub_periods_type)
708+
self.spreadOnShort, self.sub_periods_type)
707709
tenor_basis_swap.setPricingEngine(self.engine)
708710
self.assertFalse(abs(tenor_basis_swap.NPV()) > tolerance)
709711

QuantExt-SWIG/SWIG/qle_instruments.i

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ class OvernightIndexedBasisSwap : public Swap {
137137
const ext::shared_ptr<OvernightIndex>& overnightIndex,
138138
const QuantLib::Schedule& iborSchedule,
139139
const ext::shared_ptr<IborIndex>& iborIndex,
140+
const bool spreadOnShort = true,
140141
QuantLib::Spread oisSpread = 0.0,
141-
QuantLib::Spread iborSpread = 0.0);
142+
QuantLib::Spread iborSpread = 0.0,
143+
const bool telescopicValueDates = false);
142144
QuantLib::Real nominal() const ;
143145
const QuantLib::Schedule& oisSchedule();
144146
const QuantLib::Schedule& iborSchedule();

QuantExt-SWIG/SWIG/qle_tenorbasisswap.i

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ class TenorBasisSwap : public Swap {
7979
const QuantLib::Period& shortPayTenor,
8080
QuantLib::DateGeneration::Rule rule = QuantLib::DateGeneration::Backward,
8181
bool includeSpread = false,
82+
bool spreadOnShort = true,
8283
QuantExt::SubPeriodsCoupon1::Type type = QuantExt::SubPeriodsCoupon1::Compounding);
8384
TenorBasisSwap(QuantLib::Real nominal,
8485
bool payLongIndex,
@@ -89,6 +90,7 @@ class TenorBasisSwap : public Swap {
8990
const ext::shared_ptr<IborIndex>& shortIndex,
9091
QuantLib::Spread shortSpread,
9192
bool includeSpread = false,
93+
bool spreadOnShort = true,
9294
QuantExt::SubPeriodsCoupon1::Type type = QuantExt::SubPeriodsCoupon1::Compounding);
9395
QuantLib::Real nominal() const;
9496
bool payLongIndex();

0 commit comments

Comments
 (0)