32 ext::shared_ptr<OvernightIndex> overnightIndex,
35 Real meanReversionSpeed,
40 overnightIndex_(
std::move(overnightIndex)), discountHandle_(
std::move(discount)),
41 fixedLegPaymentFrequency_(fixedLegPaymentFrequency),
42 overnightLegPaymentFrequency_(overnightLegPaymentFrequency), spread_(
std::move(spread)),
43 mrs_(meanReversionSpeed),
vol_(volatility), byApprox_(byApprox) {
54 ext::shared_ptr<IborIndex> clonedIborIndex =
56 ext::shared_ptr<OvernightIndex> clonedOvernightIndex =
57 ext::dynamic_pointer_cast<OvernightIndex>(clonedIborIndex);
73 bool observer =
false;
92 static const Spread basisPoint = 1.0e-4;
93 Real floatingLegNPV =
swap_->overnightLegNPV();
95 Real spreadNPV =
swap_->overnightLegBPS() / basisPoint*spread;
96 Real totNPV = -(floatingLegNPV + spreadNPV);
97 Real result = totNPV / (
swap_->fixedLegBPS() / basisPoint);
Arithmetic Average Overnight Indexed Swap rate helpers.
ext::shared_ptr< SimpleQuote > vol_
degenerate base class for the Acyclic Visitor pattern
ext::shared_ptr< OvernightIndex > overnightIndex_
RelinkableHandle< YieldTermStructure > discountRelinkableHandle_
void setTermStructure(YieldTermStructure *) override
RelinkableHandle< YieldTermStructure > termStructureHandle_
Frequency fixedLegPaymentFrequency_
Handle< YieldTermStructure > discountHandle_
void accept(AcyclicVisitor &) override
void initializeDates() override
Real impliedQuote() const override
ArithmeticOISRateHelper(Natural settlementDays, const Period &tenor, Frequency fixedLegPaymentFrequency, const Handle< Quote > &fixedRate, ext::shared_ptr< OvernightIndex > overnightIndex, Frequency overnightLegPaymentFrequency, Handle< Quote > spread, Real meanReversionSpeed=0.03, Real volatility=0.00, bool byApprox=false, Handle< YieldTermStructure > discountingCurve=Handle< YieldTermStructure >())
ext::shared_ptr< ArithmeticAverageOIS > swap_
Frequency overnightLegPaymentFrequency_
virtual void accept(AcyclicVisitor &)
virtual void setTermStructure(TS *)
sets the term structure to be used for pricing
Shared handle to an observable.
MakeArithmeticAverageOIS & withFixedLegPaymentFrequency(Frequency f)
MakeArithmeticAverageOIS & withArithmeticAverage(Real meanReversionSpeed=0.03, Real volatility=0.00, bool byApprox=false)
MakeArithmeticAverageOIS & withDiscountingTermStructure(const Handle< YieldTermStructure > &discountingTermStructure)
MakeArithmeticAverageOIS & withSettlementDays(Natural settlementDays)
MakeArithmeticAverageOIS & withOvernightLegPaymentFrequency(Frequency f)
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
Bootstrap helper with date schedule relative to global evaluation date.
Visitor for a specific class
virtual void visit(T &)=0
Interest-rate term structure.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Frequency
Frequency of events.
unsigned QL_INTEGER Natural
positive integer
Real Spread
spreads on interest rates
Helper class to instantiate overnight indexed swaps.
empty deleter for shared_ptr
ext::shared_ptr< BlackVolTermStructure > v