Login  Register

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

Posted by Clinton Mead-3 on Mar 19, 2007; 2:30pm
URL: http://quantlib.414.s1.nabble.com/How-to-use-fractional-decimal-years-for-theoretical-calculations-of-option-prices-tp701.html

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.

Ideally I'd want the option to use the above constructors like the following:

EuropeanExercise(Real timeToMaturity);
FlatForward(Real riskFreeRate);
FlatForward(Real dividendYield);
BlackConstantVol(Real volatility);

This way I do not have to worry about the implimentation of the calendar affecting my results. And also I could choose arbitary lengths, instead of being constrained to day boundaries.

If anyone knows a way to solve/work around this issue, help would be much appreciated.

Thanks

Clinton

-------------------------------------------------------------------------
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