Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
strike.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 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 ored/utilities/strike.hpp
20 \brief strike description
21 \ingroup utilities
22*/
23
24#pragma once
25
26#include <ql/types.hpp>
27#include <string>
28
29namespace ore {
30namespace data {
31
32struct Strike {
33 enum class Type {
34 ATM,
35 ATMF,
38 Delta,
41 BF,
42 RR,
45 };
47 QuantLib::Real value;
48};
49
50//! Convert text to Strike
51/*!
52\ingroup utilities
53*/
54Strike parseStrike(const std::string& s);
55
56//! Convert Strike to text
57/*!
58\ingroup utilities
59*/
60std::ostream& operator<<(std::ostream& out, const Strike& s);
61
62//! Convert Strike to text
63/*!
64\ingroup utilities
65*/
66std::ostream& operator<<(std::ostream& out, const Strike& s);
67
68//! Logical comparison of strikes
69/*!
70\ingroup utilities
71*/
72bool operator==(const Strike& s1, const Strike& s2);
73
74//! Convenience function that computes an absolute strike
75/*!
76\ingroup utilities
77*/
78QuantLib::Real computeAbsoluteStrike(const Strike& s, const QuantLib::Real atm, const QuantLib::Real atmf);
79
80//! Utility class for handling delta strings ATM, 10P, 25C, ... used e.g. for FX Surfaces
82public:
83 DeltaString(const std::string& s);
84 bool isAtm() const { return isAtm_; }
85 bool isPut() const { return isPut_; }
86 bool isCall() const { return isCall_; }
87 Real delta() const { return delta_; }
88
89private:
91 Real delta_;
92};
93
94} // namespace data
95} // namespace ore
Utility class for handling delta strings ATM, 10P, 25C, ... used e.g. for FX Surfaces.
Definition: strike.hpp:81
bool isCall() const
Definition: strike.hpp:86
bool isAtm() const
Definition: strike.hpp:84
Real delta() const
Definition: strike.hpp:87
bool isPut() const
Definition: strike.hpp:85
Strike parseStrike(const std::string &s)
Convert text to Strike.
Definition: strike.cpp:30
QuantLib::Real computeAbsoluteStrike(const Strike &s, const QuantLib::Real atm, const QuantLib::Real atmf)
Convenience function that computes an absolute strike.
Definition: strike.cpp:167
@ data
Definition: log.hpp:77
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
bool operator==(const Dividend &d1, const Dividend &d)
Serializable Credit Default Swap.
Definition: namespaces.docs:23
QuantLib::Real value
Definition: strike.hpp:47