Create option pricing engine structure, test architecture.
Some checks failed
C++ CI / build (push) Has been cancelled
Some checks failed
C++ CI / build (push) Has been cancelled
This commit is contained in:
17
src/Instrument.cpp
Normal file
17
src/Instrument.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// Created by David Doebel on 05.03.2026.
|
||||
//
|
||||
|
||||
#include "Instrument.hpp"
|
||||
|
||||
Instrument::Instrument(double maturity, std::unique_ptr<Payoff> payoff,
|
||||
std::unique_ptr<PricingEngine> engine) : maturity_(maturity), payoff_(std::move(payoff)), engine_
|
||||
(std::move(engine)){
|
||||
}
|
||||
|
||||
|
||||
|
||||
double Instrument::price() const {
|
||||
return engine_->calculate(*this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user