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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Clinton Mead-3
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
Reply | Threaded
Open this post in threaded view
|

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

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