6#include "../../internal/Conf.hpp"
10#include "../../internal/Common.hpp"
11#include "./OptionSeries.hpp"
18
19
20
21
22
23
24
25
26template <
typename T>
class OptionChain final {
29 std::string symbol_{};
30 std::set<OptionSeries<T>> series_{};
32 explicit OptionChain(
const StringLike& symbol) : symbol_(symbol) {
35 void addOption(
const OptionSeries<T> &series,
bool isCall,
double strike, std::shared_ptr<T> option) {
36 auto it = series_.find(series);
38 if (it == series_.end()) {
39 OptionSeries<T> os(series);
40 os.addOption(isCall, strike, option);
43 OptionSeries<T> modifiedSeries = *it;
45 modifiedSeries.addOption(isCall, strike, option);
46 series_.insert(modifiedSeries);
52
53
54
55
61
62
63
64
#define DXFCXX_DISABLE_MSC_WARNINGS_POP()
Definition Conf.hpp:31
#define DXFCPP_END_NAMESPACE
Definition Conf.hpp:97
#define DXFCPP_BEGIN_NAMESPACE
Definition Conf.hpp:94
#define DXFCXX_DISABLE_MSC_WARNINGS_PUSH(warnings)
Definition Conf.hpp:30
const std::string & getSymbol() const &
Returns symbol (product or underlying) of this option chain.
Definition OptionChain.hpp:56
std::set< OptionSeries< T > > getSeries()
Returns a sorted set of option series of this option chain.
Definition OptionChain.hpp:65
Builder class for a set of option chains grouped by product or underlying symbol.
Definition OptionChainsBuilder.hpp:27
A lightweight wrapper around strings or string-like inputs.
Definition StringUtils.hpp:27