Login  Register

Re: How to use fractional/decimal years for theoretical calculations of option prices?

Posted by Luigi Ballabio on Mar 29, 2007; 2:44pm
URL: http://quantlib.414.s1.nabble.com/How-to-use-fractional-decimal-years-for-theoretical-calculations-of-option-prices-tp701p702.html

On Tue, 2007-03-20 at 00:30 +1100, Clinton Mead wrote:
> I've been working out some European option values, largely using the code in http://quantlib.org/reference/_equity_option_8cpp-example.html . However, the code in those examples accepts Dates as time parameters. In particular, these constructors:
>
> EuropeanExercise(Date maturityDate);
> FlatForward(Date settlementDate, Real riskFreeRate, DayCounter dayCounter);
> FlatForward(Date settlementDate, Real dividendYield, DayCounter dayCounter);
> BlackConstantVol(Date settlementDate, Real volatility, DayCounter dayCounter);
>
> However, I'd like to use arbitary periods, such as 0.1 of a year, as lengths of time til maturity. Converting these to dates may result in rounding to the nearest day and affect the results. Also, I want to avoid leap years/month lengths/public holidays etc from affecting any results. I attempted to use the period class but it seemed to take only integer values of years and days.

Clinton,
        apologies for the late reply. Currently it's not easy to build an
option using times as such. If you're interested in European options,
you can use the facilities in ql/PricingEngines/blackformula.hpp or
ql/PricingEngines/blackcalculator.hpp instead.

Later,
        Luigi

----------------------------------------

There is no such thing as public opinion. There is only published
opinion.
-- Winston Churchill



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users