Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
equityforwardcurvestripper.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2019 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file qle/termstructures/equityforwardcurvestripper.hpp
20 \brief Imply equity forwards from option put/call parity
21 \ingroup termstructures
22*/
23
24#ifndef quantext_equity_forward_curve_stripper_hpp
25#define quantext_equity_forward_curve_stripper_hpp
26
27#include <ql/exercise.hpp>
28#include <ql/patterns/lazyobject.hpp>
29#include <ql/termstructures/yieldtermstructure.hpp>
31
32namespace QuantExt {
33
34class EquityForwardCurveStripper : public QuantLib::LazyObject {
35
36public:
37 EquityForwardCurveStripper(const QuantLib::ext::shared_ptr<OptionPriceSurface>& callSurface,
38 const QuantLib::ext::shared_ptr<OptionPriceSurface>& putSurface,
39 QuantLib::Handle<QuantLib::YieldTermStructure>& forecastCurve,
40 QuantLib::Handle<QuantLib::Quote>& equitySpot,
41 QuantLib::Exercise::Type type = QuantLib::Exercise::European);
42
43 //! return the expiries
44 const std::vector<QuantLib::Date> expiries() const;
45 //! return the stripped forwards
46 const std::vector<QuantLib::Real> forwards() const;
47
48 //! \name LazyObject interface
49 //@{
50 void performCalculations() const override;
51 //@}
52
53private:
54 const QuantLib::ext::shared_ptr<OptionPriceSurface> callSurface_;
55 const QuantLib::ext::shared_ptr<OptionPriceSurface> putSurface_;
56 QuantLib::Handle<QuantLib::YieldTermStructure> forecastCurve_;
57 QuantLib::Handle<QuantLib::Quote> equitySpot_;
58 QuantLib::Exercise::Type type_;
59
60 //! store the stripped forward rates
61 mutable std::vector<QuantLib::Real> forwards_;
62
63 QuantLib::Real forwardFromPutCallParity(QuantLib::Date d, QuantLib::Real call,
64 const OptionPriceSurface& callSurface,
65 const OptionPriceSurface& putSurface) const;
66};
67
68} // namespace QuantExt
69#endif
QuantLib::Handle< QuantLib::YieldTermStructure > forecastCurve_
const QuantLib::ext::shared_ptr< OptionPriceSurface > callSurface_
const QuantLib::ext::shared_ptr< OptionPriceSurface > putSurface_
QuantLib::Real forwardFromPutCallParity(QuantLib::Date d, QuantLib::Real call, const OptionPriceSurface &callSurface, const OptionPriceSurface &putSurface) const
const std::vector< QuantLib::Date > expiries() const
return the expiries
QuantLib::Handle< QuantLib::Quote > equitySpot_
std::vector< QuantLib::Real > forwards_
store the stripped forward rates
const std::vector< QuantLib::Real > forwards() const
return the stripped forwards
Surface to store option prices.