Closed mike1232 closed 8 years ago
BlackVarianceSurface atm is not implemented in QLNet.
I implemented BlackVarianceSurface
. You can find it in the master branch. However, I don't have any test cases and I'm unsure how buggy my implementation is. @mike1232 , if you can provide some tests, it would help a lot.
moved on Ver-1.6 branch
See #76
In the option examples, QLNet uses the flat term structures for r, q and volatility. how to use the curve term structures? in particular, how to set up a volatility surface and use the surface as input for the pricing engines? In QuantLib C++, you can create a wrapper:
boost::shared_ptr ForwardImpliedVolSurface(Date todaysDate, Date forwardDate, Calendar calendar, std::vector maturityArray, std::vector strikeArray, Matrix volatilityMatrix)
{
// Handle to boost::shared_ptr
DayCounter dayCounter = Actual365Fixed();
boost::shared_ptr volatilitySurface(new BlackVarianceSurface(todaysDate, calendar, maturityArray, strikeArray, volatilityMatrix, dayCounter));
Handle volatilitySurfaceH(volatilitySurface);
// Volatility surface interpolation volatilitySurface->enableExtrapolation(true);
// Change interpolator to bicubic splines volatilitySurface->setInterpolation(Bicubic());
// Forward implied volatility surface boost::shared_ptr forwardVolSurface(new ImpliedVolTermStructure(volatilitySurfaceH, forwardDate));
return(forwardVolSurface); }
how does QLNet achieve this?
Thanks Mike