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:
18
src/Payoff.cpp
Normal file
18
src/Payoff.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// Created by David Doebel on 05.03.2026.
|
||||
//
|
||||
|
||||
#include "Payoff.hpp"
|
||||
#include <algorithm>
|
||||
|
||||
double CallPayoff::operator()(double S) {
|
||||
return std::max(0., S - strike_);
|
||||
}
|
||||
|
||||
double PutPayoff::operator()(double S) {
|
||||
return std::max(0., strike_ - S);
|
||||
}
|
||||
|
||||
double DigitalPayoff::operator()(double S) {
|
||||
return S > strike_ ? 1. : 0.;
|
||||
}
|
||||
Reference in New Issue
Block a user