Re: Python Swig TypeError in DividendVanillaOption method

Posted by Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Python-Swig-TypeError-in-DividendVanillaOption-method-tp5356p5357.html


On Dec 20, 2007, at 2:37 AM, vema wrote:

> I am trying to evaluate the price of a dividend American Option and i
> was
> using the DividendVanillaOption method for obtaining it in Python. (I
> have
> been abel to successfuly build the  Quantlib libs via the SWIG-python
> access methods)
> However I am gettign this error which says
>
> dividendDates=(Date(17,June,1998),Date(17,July,1998))
> dividends=(0.07,0.5)
> option =
> DividendVanillaOption(payoff,exercise,dividendDates,dividends);
>
> TypeError:  in method 'new_DividendVanillaOption', argument 4 of type
> 'std::vector<Real,std::allocator<Real > > const &'

Mahesh,
        this is fixed in the upcoming 0.9.0 release. In the meantime, instead
of

dividends = (0.07,0.5)

you'll have to use the more verbose:

dividends = DoubleVector(2)
dividends[0] = 0.07
dividends[1] = 0.5

Later,
        Luigi



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users