1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//! Traits for calculating the Greeks of an option.
use crate::options::Option;
/// Trait for calculating the Greeks of an option.
pub trait OptionGreeks {
// First-order Greeks
/// Delta measures the rate of change of the option price with respect to changes in the price of the underlying asset.
fn delta<T: Option>(&self, option: &T) -> f64 {
panic!("Delta not implemented for this model");
}
/// Vega measures the rate of change of the option price with respect to changes in the volatility of the underlying asset.
fn vega<T: Option>(&self, option: &T) -> f64 {
panic!("Vega not implemented for this model");
}
/// Theta measures the rate of change of the option price with respect to changes in time to maturity.
fn theta<T: Option>(&self, option: &T) -> f64 {
panic!("Theta not implemented for this model");
}
/// Rho measures the rate of change of the option price with respect to changes in the risk-free interest rate.
fn rho<T: Option>(&self, option: &T) -> f64 {
panic!("Rho not implemented for this model");
}
/// Lambda measures the rate of change of the option delta with respect to changes in the risk-free interest rate.
fn lambda<T: Option>(&self, option: &T) -> f64 {
panic!("Lambda not implemented for this model");
}
/// Epsilon measures the rate of change of the option delta with respect to changes in the dividend yield.
fn epsilon<T: Option>(&self, option: &T) -> f64 {
panic!("Epsilon not implemented for this model");
}
// Second-order Greeks
/// Gamma measures the rate of change of the option delta with respect to changes in the price of the underlying asset.
fn gamma<T: Option>(&self, option: &T) -> f64 {
panic!("Gamma not implemented for this model");
}
/// Vanna measures the rate of change of the option delta with respect to changes in the volatility of the underlying asset.
fn vanna<T: Option>(&self, option: &T) -> f64 {
panic!("Vanna not implemented for this model");
}
/// Charm measures the rate of change of the option delta with respect to changes in time to maturity.
fn charm<T: Option>(&self, option: &T) -> f64 {
panic!("Charm not implemented for this model");
}
/// Vomma measures the rate of change of the option vega with respect to changes in the volatility of the underlying asset.
fn vomma<T: Option>(&self, option: &T) -> f64 {
panic!("Vomma not implemented for this model");
}
/// Veta measures the rate of change of the option vega with respect to changes in time to maturity.
fn veta<T: Option>(&self, option: &T) -> f64 {
panic!("Veta not implemented for this model");
}
/// Vera measures the rate of change of the option gamma with respect to changes in the volatility of the underlying asset.
fn vera<T: Option>(&self, option: &T) -> f64 {
panic!("Vera not implemented for this model");
}
// Third-order Greeks
/// Speed measures the rate of change of the option gamma with respect to changes in the price of the underlying asset.
fn speed<T: Option>(&self, option: &T) -> f64 {
panic!("Speed not implemented for this model");
}
/// Zomma measures the rate of change of the option gamma with respect to changes in the volatility of the underlying asset.
fn zomma<T: Option>(&self, option: &T) -> f64 {
panic!("Zomma not implemented for this model");
}
/// Color measures the rate of change of the option gamma with respect to changes in time to maturity.
fn color<T: Option>(&self, option: &T) -> f64 {
panic!("Color not implemented for this model");
}
/// Ultima measures the rate of change of the option vomma with respect to changes in the volatility of the underlying asset.
fn ultima<T: Option>(&self, option: &T) -> f64 {
panic!("Ultima not implemented for this model");
}
/// Parmicharma measures the rate of change of charm over the passage of time.
fn parmicharma<T: Option>(&self, option: &T) -> f64 {
panic!("Parmicharma not implemented for this model");
}
}