26#include <ql/experimental/fx/deltavolquote.hpp>
27#include <ql/option.hpp>
28#include <ql/types.hpp>
30#include <boost/optional.hpp>
31#include <boost/serialization/base_object.hpp>
32#include <boost/serialization/export.hpp>
33#include <boost/serialization/version.hpp>
34#include <boost/serialization/optional.hpp>
35#include <ql/shared_ptr.hpp>
48 virtual void fromString(
const std::string& strStrike) = 0;
63 template <
class Archive>
void serialize(Archive& ar,
const unsigned int version);
77 QuantLib::Real
strike()
const;
82 void fromString(
const std::string& strStrike)
override;
87 std::string
toString()
const override;
96 template <
class Archive>
void serialize(Archive& ar,
const unsigned int version);
112 QuantLib::DeltaVolQuote::DeltaType
deltaType()
const;
118 QuantLib::Real
delta()
const;
126 void fromString(
const std::string& strStrike)
override;
133 std::string
toString()
const override;
144 template <
class Archive>
void serialize(Archive& ar,
const unsigned int version);
161 boost::optional<QuantLib::DeltaVolQuote::DeltaType>
deltaType = boost::none);
166 QuantLib::DeltaVolQuote::AtmType
atmType()
const;
169 boost::optional<QuantLib::DeltaVolQuote::DeltaType>
deltaType()
const;
179 void fromString(
const std::string& strStrike)
override;
187 std::string
toString()
const override;
194 boost::optional<QuantLib::DeltaVolQuote::DeltaType>
deltaType_;
201 template <
class Archive>
void serialize(Archive& ar,
const unsigned int version);
235 void fromString(
const std::string& strStrike)
override;
241 std::string
toString()
const override;
252 template <
class Archive>
void serialize(Archive& ar,
const unsigned int version);
259std::ostream&
operator<<(std::ostream& os, QuantLib::DeltaVolQuote::DeltaType type);
262std::ostream&
operator<<(std::ostream& os, QuantLib::DeltaVolQuote::AtmType type);
271QuantLib::ext::shared_ptr<BaseStrike>
parseBaseStrike(
const std::string& strStrike);
274 ar.template register_type<AbsoluteStrike>();
275 ar.template register_type<DeltaStrike>();
276 ar.template register_type<AtmStrike>();
277 ar.template register_type<MoneynessStrike>();
bool equal_to(const BaseStrike &other) const override
Override in derived classes to compare specific Strikes.
void serialize(Archive &ar, const unsigned int version)
void fromString(const std::string &strStrike) override
QuantLib::Real strike() const
Return the absolute strike level.
AbsoluteStrike(QuantLib::Real strike)
Constructor with explicit strike.
friend class boost::serialization::access
Serialization.
std::string toString() const override
AbsoluteStrike()
Default constructor.
QuantLib::DeltaVolQuote::AtmType atmType_
void check() const
Perform validation.
bool equal_to(const BaseStrike &other) const override
Override in derived classes to compare specific Strikes.
void fromString(const std::string &strStrike) override
boost::optional< QuantLib::DeltaVolQuote::DeltaType > deltaType() const
Return the delta type.
AtmStrike()
Default constructor.
QuantLib::DeltaVolQuote::AtmType atmType() const
Return the ATM type.
AtmStrike(QuantLib::DeltaVolQuote::AtmType atmType, boost::optional< QuantLib::DeltaVolQuote::DeltaType > deltaType=boost::none)
friend class boost::serialization::access
Serialization.
std::string toString() const override
void serialize(Archive &ar, const unsigned int version)
boost::optional< QuantLib::DeltaVolQuote::DeltaType > deltaType_
virtual bool equal_to(const BaseStrike &other) const =0
Override in derived classes to compare specific Strikes.
virtual void fromString(const std::string &strStrike)=0
Populate the Strike object from strStrike.
virtual std::string toString() const =0
Write the Strike object to string.
friend class boost::serialization::access
Serialization.
friend bool operator==(const BaseStrike &lhs, const BaseStrike &rhs)
Will be used for Strike comparison.
void serialize(Archive &ar, const unsigned int version)
QuantLib::Real delta() const
Return the delta level.
bool equal_to(const BaseStrike &other) const override
Override in derived classes to compare specific Strikes.
DeltaStrike()
Default constructor.
void fromString(const std::string &strStrike) override
DeltaStrike(QuantLib::DeltaVolQuote::DeltaType deltaType, QuantLib::Option::Type optionType, QuantLib::Real delta)
Explicit constructor.
QuantLib::DeltaVolQuote::DeltaType deltaType_
QuantLib::Option::Type optionType_
QuantLib::DeltaVolQuote::DeltaType deltaType() const
Return the delta type.
friend class boost::serialization::access
Serialization.
std::string toString() const override
QuantLib::Option::Type optionType() const
Return the option type.
void serialize(Archive &ar, const unsigned int version)
bool equal_to(const BaseStrike &other) const override
Override in derived classes to compare specific Strikes.
MoneynessStrike(Type type, QuantLib::Real moneyness)
Explicit constructor.
void fromString(const std::string &strStrike) override
QuantLib::Real moneyness_
QuantLib::Real moneyness() const
Return the moneyness level.
friend class boost::serialization::access
Serialization.
std::string toString() const override
MoneynessStrike()
Default constructor.
Type type() const
Return the moneyness type.
void serialize(Archive &ar, const unsigned int version)
BOOST_CLASS_EXPORT_KEY(ore::data::AbsoluteStrike)
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
MoneynessStrike::Type parseMoneynessType(const string &type)
Parse MoneynessStrike::Type from type.
QuantLib::ext::shared_ptr< BaseStrike > parseBaseStrike(const string &strStrike)
Parse a Strike from its string representation, strStrike.
void registerBaseStrike(Archive &ar)
Serializable Credit Default Swap.