Posted by
Luigi Ballabio on
Apr 09, 2010; 8:07pm
URL: http://quantlib.414.s1.nabble.com/Question-on-registerWith-for-evaluationDates-tp6582p6583.html
On Apr 9, 2010, at 9:55 PM, Tawanda Gwena wrote:
> I have the simple problem of trying to change the evaluation date
> for a basic option. For some reason I cannot seem to set the
> observer to work properly. I want to work out the price of an option
> on 15 May 2009 and 10 May 2010. The option expires on 17 May 2010.
>
> If I set the evaluation date to after expiry I (rightly) get the
> value of the option to be 0.
>
> Here is some code which I have. How can I fix/understand this?
>
> Handle<YieldTermStructure> flatTermStructure(
> boost::shared_ptr<YieldTermStructure>(
> new
> FlatForward(settlementDate,
>
> riskFreeRate,
>
> dayCounter)));
If you use the FlatForward constructor that takes a reference date,
the curve will keep calculating discounts from that date, no matter
where you move the evaluation date. Use the constructor taking a
number of settlement days instead, and the reference date will move
with the evaluation date.
Luigi
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users