Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CommodityOptionSurfaceStripper Class Reference

#include <qle/termstructures/eqcommoptionsurfacestripper.hpp>

+ Inheritance diagram for CommodityOptionSurfaceStripper:
+ Collaboration diagram for CommodityOptionSurfaceStripper:

Public Member Functions

 CommodityOptionSurfaceStripper (const QuantLib::Handle< QuantExt::PriceTermStructure > &priceCurve, const QuantLib::Handle< QuantLib::YieldTermStructure > &discountCurve, const QuantLib::ext::shared_ptr< OptionInterpolatorBase > &callSurface, const QuantLib::ext::shared_ptr< OptionInterpolatorBase > &putSurface, const QuantLib::Calendar &calendar, const QuantLib::DayCounter &dayCounter, QuantLib::Exercise::Type type=QuantLib::Exercise::European, bool lowerStrikeConstExtrap=true, bool upperStrikeConstExtrap=true, bool timeFlatExtrapolation=false, bool preferOutOfTheMoney=false, Solver1DOptions solverOptions={})
 
- Public Member Functions inherited from OptionSurfaceStripper
 OptionSurfaceStripper (const QuantLib::ext::shared_ptr< OptionInterpolatorBase > &callSurface, const QuantLib::ext::shared_ptr< OptionInterpolatorBase > &putSurface, const QuantLib::Calendar &calendar, const QuantLib::DayCounter &dayCounter, QuantLib::Exercise::Type type=QuantLib::Exercise::European, bool lowerStrikeConstExtrap=true, bool upperStrikeConstExtrap=true, bool timeFlatExtrapolation=false, bool preferOutOfTheMoney=false, Solver1DOptions solverOptions={})
 
void performCalculations () const override
 
QuantLib::ext::shared_ptr< QuantLib::BlackVolTermStructure > volSurface ()
 Return the stripped volatility structure. More...
 

OptionSurfaceStripper interface

QuantLib::Handle< QuantExt::PriceTermStructurepriceCurve_
 
QuantLib::Handle< QuantLib::YieldTermStructure > discountCurve_
 
QuantLib::ext::shared_ptr< QuantLib::GeneralizedBlackScholesProcess > process (const QuantLib::ext::shared_ptr< QuantLib::SimpleQuote > &volatilityQuote) const override
 Generate the relevant Black Scholes process for the underlying. More...
 
QuantLib::Real forward (const QuantLib::Date &date) const override
 Return the forward price at a given date. More...
 

Additional Inherited Members

- Protected Member Functions inherited from OptionSurfaceStripper
- Protected Attributes inherited from OptionSurfaceStripper
QuantLib::ext::shared_ptr< OptionInterpolatorBasecallSurface_
 
QuantLib::ext::shared_ptr< OptionInterpolatorBaseputSurface_
 
const QuantLib::Calendar & calendar_
 
const QuantLib::DayCounter & dayCounter_
 
QuantLib::Exercise::Type type_
 
bool lowerStrikeConstExtrap_
 
bool upperStrikeConstExtrap_
 
bool timeFlatExtrapolation_
 
bool preferOutOfTheMoney_
 

Detailed Description

Definition at line 178 of file eqcommoptionsurfacestripper.hpp.

Constructor & Destructor Documentation

◆ CommodityOptionSurfaceStripper()

CommodityOptionSurfaceStripper ( const QuantLib::Handle< QuantExt::PriceTermStructure > &  priceCurve,
const QuantLib::Handle< QuantLib::YieldTermStructure > &  discountCurve,
const QuantLib::ext::shared_ptr< OptionInterpolatorBase > &  callSurface,
const QuantLib::ext::shared_ptr< OptionInterpolatorBase > &  putSurface,
const QuantLib::Calendar &  calendar,
const QuantLib::DayCounter &  dayCounter,
QuantLib::Exercise::Type  type = QuantLib::Exercise::European,
bool  lowerStrikeConstExtrap = true,
bool  upperStrikeConstExtrap = true,
bool  timeFlatExtrapolation = false,
bool  preferOutOfTheMoney = false,
Solver1DOptions  solverOptions = {} 
)

Definition at line 343 of file eqcommoptionsurfacestripper.cpp.

356 : OptionSurfaceStripper(callSurface, putSurface, calendar, dayCounter, type, lowerStrikeConstExtrap,
357 upperStrikeConstExtrap, timeFlatExtrapolation, preferOutOfTheMoney, solverOptions),
358 priceCurve_(priceCurve), discountCurve_(discountCurve) {
359 registerWith(priceCurve_);
360 registerWith(discountCurve_);
361}
QuantLib::Handle< QuantExt::PriceTermStructure > priceCurve_
QuantLib::Handle< QuantLib::YieldTermStructure > discountCurve_
OptionSurfaceStripper(const QuantLib::ext::shared_ptr< OptionInterpolatorBase > &callSurface, const QuantLib::ext::shared_ptr< OptionInterpolatorBase > &putSurface, const QuantLib::Calendar &calendar, const QuantLib::DayCounter &dayCounter, QuantLib::Exercise::Type type=QuantLib::Exercise::European, bool lowerStrikeConstExtrap=true, bool upperStrikeConstExtrap=true, bool timeFlatExtrapolation=false, bool preferOutOfTheMoney=false, Solver1DOptions solverOptions={})

Member Function Documentation

◆ process()

QuantLib::ext::shared_ptr< GeneralizedBlackScholesProcess > process ( const QuantLib::ext::shared_ptr< QuantLib::SimpleQuote > &  volatilityQuote) const
overrideprotectedvirtual

Generate the relevant Black Scholes process for the underlying.

Implements OptionSurfaceStripper.

Definition at line 363 of file eqcommoptionsurfacestripper.cpp.

364 {
365
366 QL_REQUIRE(!priceCurve_.empty(), "CommodityOptionSurfaceStripper: price curve is empty");
367 QL_REQUIRE(!discountCurve_.empty(), "CommodityOptionSurfaceStripper: discount curve is empty");
368
369 // Volatility term structure for the process
370 Handle<BlackVolTermStructure> vts(QuantLib::ext::make_shared<BlackConstantVol>(
371 callSurface_->referenceDate(), calendar_, Handle<Quote>(volatilityQuote), dayCounter_));
372
373 // Generate "spot" and "yield" curve for the process.
374 Handle<Quote> spot(QuantLib::ext::make_shared<DerivedPriceQuote>(priceCurve_));
375 Handle<YieldTermStructure> yield(QuantLib::ext::make_shared<PriceTermStructureAdapter>(*priceCurve_, *discountCurve_));
376 yield->enableExtrapolation();
377
378 return QuantLib::ext::make_shared<QuantLib::GeneralizedBlackScholesProcess>(spot, yield, discountCurve_, vts);
379}
const QuantLib::DayCounter & dayCounter_
QuantLib::ext::shared_ptr< OptionInterpolatorBase > callSurface_

◆ forward()

Real forward ( const QuantLib::Date &  date) const
overrideprotectedvirtual

Return the forward price at a given date.

Implements OptionSurfaceStripper.

Definition at line 381 of file eqcommoptionsurfacestripper.cpp.

381 {
382 QL_REQUIRE(!priceCurve_.empty(), "CommodityOptionSurfaceStripper: price curve is empty");
383 return priceCurve_->price(date);
384}

Member Data Documentation

◆ priceCurve_

QuantLib::Handle<QuantExt::PriceTermStructure> priceCurve_
private

Definition at line 205 of file eqcommoptionsurfacestripper.hpp.

◆ discountCurve_

QuantLib::Handle<QuantLib::YieldTermStructure> discountCurve_
private

Definition at line 206 of file eqcommoptionsurfacestripper.hpp.