|
From: Luigi B. <lui...@gm...> - 2021-03-10 12:24:41
|
Hello,
in general you can use the approach described in <
https://www.youtube.com/watch?v=MgUlBB59Ll0&list=PLu_PrO8j6XAvOAlZND9WUPwTHY_GYhJVr&index=4>.
You can perturb your process and reprice (you can use quotes for that, by
the way; there's no need to use three processes). Formulas for second and
third mixed derivatives are, for instance, in the comments of <
http://www.holoborodko.com/pavel/numerical-methods/numerical-derivative/central-differences/
>.
Hope this helps,
Luigi
On Wed, Feb 24, 2021 at 8:14 AM Edward Lang <ed...@ed...> wrote:
> Hi,
>
> I am trying to calculate some of the second and third order greeks using
> QuantLib. At this stage I am maintaining three BlackScholesMertonProcess
> processes (standard; one for increased volatility; one for increased
> underlying price) and using those for some of the functions.
>
> That said, I am struggling with how I can apply this approach to greeks
> such as vomma, speed, color, ultima, etc. Does anyone have any suggestions?
> I also hope the other ones I've got are correct.
>
> # First order
> def delta(self):
> return self._ql_option.delta()
>
> def vega(self):
> return self._ql_option_for_vol_increase.NPV() -
> self._ql_option.NPV()
>
> def theta(self):
> return self._ql_option.theta()
>
> def lambda(self):
> return self._ql_option.delta() * (self._spot.value() /
> self._ql_option.NPV())
>
> def elasticity(self):
> return self.lambda()
>
> # rho: not implemented - not a priority
> # epsilon: not implemented - not a priority
>
> # Second order
> def gamma(self):
> return self._ql_option.gamma()
>
> def vanna(self):
> return self._ql_option_for_vol_increase.delta() -
> self._ql_option.delta()
>
> def charm(self):
> return self._ql_option_for_price_increase.theta() -
> self._ql_option.theta()
>
> # vomma: not implemented
> # veta: not implemented
> # vera: not implemented
>
> # Third order
> # speed: not implemented
>
> def zomma(self):
> return self._ql_option_for_vol_increase.gamma() -
> self._ql_option.gamma()
>
> # color: not implemented
> # ultima: not implemented
>
> Thanks!
>
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|