quant-pricer-cpp
Loading...
Searching...
No Matches
digital.hpp
Go to the documentation of this file.
1
2#pragma once
3
4namespace quant::digital {
5
7
8struct Params {
9 double spot;
10 double strike;
11 double rate;
12 double dividend;
13 double vol;
14 double time;
15 bool call; // true for call, false for put (pays if S_T > K for call, < K for put)
16};
17
18// Analytic Black–Scholes formulas for digitals
19double price_bs(const Params& p, Type type);
20
21} // namespace quant::digital
Digital option pricing (cash-or-nothing and asset-or-nothing)
Definition digital.hpp:4
double price_bs(const Params &p, Type type)
Definition digital.cpp:8
Type
Definition digital.hpp:6
Definition digital.hpp:8
double vol
Definition digital.hpp:13
double rate
Definition digital.hpp:11
double dividend
Definition digital.hpp:12
double spot
Definition digital.hpp:9
double time
Definition digital.hpp:14
bool call
Definition digital.hpp:15
double strike
Definition digital.hpp:10