23 internal class ModeledGreeks : Greeks
25 private Lazy<decimal> _delta;
26 private Lazy<decimal> _gamma;
27 private Lazy<decimal> _vega;
28 private Lazy<decimal> _theta;
29 private Lazy<decimal> _rho;
30 private Lazy<decimal> _lambda;
35 public override decimal Delta => _delta.Value;
40 public override decimal Gamma => _gamma.Value;
45 public override decimal Vega => _vega.Value;
50 public override decimal Theta => _theta.Value;
55 public override decimal Rho => _rho.Value;
60 public override decimal Lambda => _lambda.Value;
65 public ModeledGreeks(Func<decimal> delta, Func<decimal> gamma, Func<decimal> vega, Func<decimal> theta, Func<decimal> rho, Func<decimal> lambda)
67 _delta =
new Lazy<decimal>(delta, isThreadSafe:
false);
68 _gamma =
new Lazy<decimal>(gamma, isThreadSafe:
false);
69 _vega =
new Lazy<decimal>(vega, isThreadSafe:
false);
70 _theta =
new Lazy<decimal>(theta, isThreadSafe:
false);
71 _rho =
new Lazy<decimal>(rho, isThreadSafe:
false);
72 _lambda =
new Lazy<decimal>(lambda, isThreadSafe:
false);