以下は、Quantlib blackvariance サーフェスを使用するための私のコードです。しかし、それは不平を言います。アドバイスできますか?この関数では、6 つの変数を使用して Blackvariance 関数を呼び出しています。
from QuantLib import *
# global data
todaysDate = Date(24,September,2013)
Settings.instance().evaluationDate = todaysDate
settlementDate = Date(24,September,2013)
riskFreeRate = FlatForward(settlementDate, 0.0025, Actual365Fixed())
# option parameters
exercise = EuropeanExercise(Date(23,December,2013))
payoff = PlainVanillaPayoff(Option.Call, 170.365)
# market data
underlying = SimpleQuote(170.365)
volatility = BlackConstantVol(todaysDate, TARGET(), 0.13538, Actual365Fixed())
dividendYield = FlatForward(settlementDate, 0.0227, Actual365Fixed())
dc=ActualActual()
eurexCal=Germany.Eurex
print eurexCal
dateVec=[]
strikes=[]
blackVolMatrix=[]
vol=[]
for i in range(10):
dateVec.append(Date(24, October, 2013)+Period(i, Months))
strikes.append(170+i*10)
vol.append(0.1+i/10)
def create_matrix(m, n):
return [[0.1]*n for _ in xrange(m)]
blackVolMatrix = create_matrix(10, 10)
#for x in range (10):
# for y in range(10):
# blackVolMatrix[x,y]=0.1
volsurf=BlackVarianceSurface(settlementDate,eurexCal,dateVec,
strikes,blackVolMatrix,dc)
6番目の引数を追加しました。* ** * ** * ** * *
エラーメッセージ:
Traceback (most recent call last):
File "/home/chandra/Software/snotes/test4.py", line 39, in <module>
strikes,blackVolMatrix,dc)
File "/usr/local/lib/python2.7/dist-packages/QuantLib/QuantLib.py", line 3371, in __init__
this = _QuantLib.new_BlackVarianceSurface(*args)
NotImplementedError: Wrong number or type of arguments for overloaded function 'new_BlackVarianceSurface'.
Possible C/C++ prototypes are:
BlackVarianceSurfacePtr(Date const &,Calendar const &,std::vector< Date,std::allocator< Date > > const &,std::vector< Real,std::allocator< Real > > const &,Matrix const &,DayCounter const &,BlackVarianceSurface::Extrapolation,BlackVarianceSurface::Extrapolation)
BlackVarianceSurfacePtr(Date const &,Calendar const &,std::vector< Date,std::allocator< Date > > const &,std::vector< Real,std::allocator< Real > > const &,Matrix const &,DayCounter const &,BlackVarianceSurface::Extrapolation)
BlackVarianceSurfacePtr(Date const &,Calendar const &,std::vector< Date,std::allocator< Date > > const &,std::vector< Real,std::allocator< Real > > const &,Matrix const &,DayCounter const &)