|
From: Morpheous <tak...@ho...> - 2012-08-01 01:46:05
|
I am using the Python binding to Quantlib to perform calculations on historic
data.
After setting up the required framework (curves etc), When I call
`option.ImpliedVolatility()` I get the following exception thrown (for
options that have expired):
File "/usr/local/lib/python2.6/dist-packages/QuantLib/QuantLib.py",
line 3683, in impliedVolatility
def impliedVolatility(self, *args): return
_QuantLib.VanillaOption_impliedVolatility(self, *args)
RuntimeError: option expired
A snippet of the lines of code for setting up required curves etc is shown
below:
dividend_yield = YieldTermStructureHandle(FlatForward(0,
TARGET(), div_yield, Actual365Fixed()))
risk_free_rate = YieldTermStructureHandle(FlatForward(0,
TARGET(), rf_rate, Actual365Fixed()))
volatility = BlackVolTermStructureHandle(BlackConstantVol(0,
TARGET(), annualized_histvol, Actual360()))
I **STRONGLY** suspect that the `TARGET()` macro used defaults to the
current system date.
How may I set up the library to use a specific historic date?
--
View this message in context: http://old.nabble.com/TARGET%28%29-macro-and-default-calendar-%28RuntimeError%3A-option-expired%29-tp34238686p34238686.html
Sent from the quantlib-dev mailing list archive at Nabble.com.
|