Login  Register

European Option that comes due "this" month

Posted by Robert F. Hoffman on Nov 03, 2004; 7:46am
URL: http://quantlib.414.s1.nabble.com/European-Option-that-comes-due-this-month-tp3410.html

I am interested in using the Black Scholes calculation on an option
which comes due in the current month.

By editing the example to hard-code the current month in the today,
settlement, and exercise date fields I get the following error in
blackvariancesurface.cpp:55:

QuantLib::BlackVarianceSurface::BlackVarianceSurface(const
QuantLib::Date&, const std::vector<QuantLib::Date,
std::allocator<QuantLib::Date> >&, const std::vector<Time,
std::allocator<Time> >&, const QuantLib::Matrix&,
QuantLib::BlackVarianceSurface::Extrapolation,
QuantLib::BlackVarianceSurface::Extrapolation, const
QuantLib::DayCounter&): dates must be sorted unique!

I get the same error even if I change this:
dates[0] = settlementDate.plusMonths(1);
to this:
dates[0] = settlementDate;

Is this just some documentation insufficiency or something  missing in
the interface?  Can a Black Scholes calculation be done on this month,
and if so, how?

(Note: Is there any more comprehensive documentation on how to use this
feature other than the example and the class description?)

Thanks in advance.
Robert Hoffman