|
From: Edward L. <ed...@ed...> - 2021-02-24 07:11:07
|
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!
|