0
$\begingroup$

I use QuantLib in Python. Now I have implied volatility surface data. How can I get the local vol surface than using finite difference method to price a barrier option in QuantLib?

$\endgroup$
  • $\begingroup$ I use BlackVarianceSurface to get the implied vol surface. Then use LocalVolSurface to get the local vol surface. When using GeneralizedBlackScholesProcess, I don't know how to use the local vol surface. $\endgroup$ – Bryce Xu Aug 30 '18 at 6:18
  • $\begingroup$ In GeneralizedBlackScholesProcess, the model looks like this - dlnS(t)=(r(t)−q(t)−σ(t,S))dt+σdWt. However, I want the sigma before dWt to be local, no constant. ALso, I found that in Python, GeneralizedBlackScholesProcess can only use blackvol but not local vol surface. $\endgroup$ – Bryce Xu Aug 30 '18 at 6:19
1
$\begingroup$

From a cursory look, the FdBlackScholesBarrierEngine seems to do what you want; when the localVol parameter is set to true, it will use the local volatility contained in the passed process. I'd suggest you to check the code, though.

As a further note: the GeneralizedBlackScholesProcess class converts the Black volatility to the local one internally (see the code here) so you might not need to.

$\endgroup$
  • $\begingroup$ Thanks for your answer. I wanna know how The GeneralizedBlackScholesProcess class converts the Black volatility to local one internally. I am new to QuantLib. In the parameters list, I need to input blackVolTS and localVolTS. Currently I only know BlackConstantVol. Is there any other kind blackvol in QuantLib? $\endgroup$ – Bryce Xu Aug 30 '18 at 10:12
  • $\begingroup$ One constructor takes Black vol and local vol; the other doesn't. $\endgroup$ – Luigi Ballabio Aug 30 '18 at 14:42
  • $\begingroup$ The conversion is at github.com/lballabio/QuantLib/blob/master/ql/processes/… $\endgroup$ – Luigi Ballabio Aug 30 '18 at 14:42
  • $\begingroup$ But when I use the constructor taking Black vol and Local vol, the model is under this one - d\ln S(t) = (r(t) - q(t) - \frac{\sigma(t, S)^2}{2}) dt + \sigma dW_t.. I wanna price the option under this one - dSt = rStdt + σ(t,St)Std_Wt. Can I do that in the QuantLib? $\endgroup$ – Bryce Xu Aug 31 '18 at 0:49
  • $\begingroup$ No, the implementation of the BS process is based on log(S). $\endgroup$ – Luigi Ballabio Aug 31 '18 at 7:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.