Note that there are some explanatory texts on larger screens.

plurals
  1. POQuantlib - BlackVariancesurface
    primarykey
    data
    text
    <p>Below is my code for using Quantlib blackvariance surface. But it complains. can you advise? In this function I am calling the Blackvariance function with 6 variables</p> <hr> <pre><code>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) </code></pre> <p><em><strong>I have added the 6th argument. *</em>**<em>*</em>**<em>*</em>**<em>*</em>*</strong></p> <p>Error Message:</p> <pre><code>Traceback (most recent call last): File "/home/chandra/Software/snotes/test4.py", line 39, in &lt;module&gt; 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 &amp;,Calendar const &amp;,std::vector&lt; Date,std::allocator&lt; Date &gt; &gt; const &amp;,std::vector&lt; Real,std::allocator&lt; Real &gt; &gt; const &amp;,Matrix const &amp;,DayCounter const &amp;,BlackVarianceSurface::Extrapolation,BlackVarianceSurface::Extrapolation) BlackVarianceSurfacePtr(Date const &amp;,Calendar const &amp;,std::vector&lt; Date,std::allocator&lt; Date &gt; &gt; const &amp;,std::vector&lt; Real,std::allocator&lt; Real &gt; &gt; const &amp;,Matrix const &amp;,DayCounter const &amp;,BlackVarianceSurface::Extrapolation) BlackVarianceSurfacePtr(Date const &amp;,Calendar const &amp;,std::vector&lt; Date,std::allocator&lt; Date &gt; &gt; const &amp;,std::vector&lt; Real,std::allocator&lt; Real &gt; &gt; const &amp;,Matrix const &amp;,DayCounter const &amp;) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload