I'd like to calculate the Black-Scholes theoretical value of an option.
I'm new to QuantLib and kind-of new to quantitative finance. I'm using EquityOption.cpp as a base for my code. Here is the relevant setup (questions at bottom): //========================== // Underlying price shared_ptr<SimpleQuote> underlyingPrice(new SimpleQuote(stockPrice)); // Dividend term structure shared_ptr<YieldTermStructure> dividendTS(new FlatForward(expiryDate, dividend, Actual360())); // Interest rate term structure shared_ptr<YieldTermStructure> interestTS(new FlatForward(expiryDate, interest, Actual360())); // Historical volatility term structure shared_ptr<BlackVolTermStructure> volatilityTS(new BlackConstantVol(expiryDate, historicalVolitility, Actual360())); shared_ptr<StrikedTypePayoff> payoff(new PlainVanillaPayoff(type, strikePrice)); shared_ptr<Exercise> exercise(new AmericanExercise(Date::todaysDate(), expiryDate)); shared_ptr<QuantLib::GeneralizedBlackScholesProcess> stochasticProcess(new QuantLib::GeneralizedBlackScholesProcess( Handle<Quote>(underlyingPrice), Handle<YieldTermStructure>(dividendTS), Handle<YieldTermStructure>(interestTS), Handle<BlackVolTermStructure>(volatilityTS))); shared_ptr<PricingEngine> engine(new BinomialVanillaEngine<CoxRossRubinstein>(150)); VanillaOption option(stochasticProcess, payoff, exercise, engine); //========================== I have two questions: 1. what does the "price" argument to option.impliedVolatility() represent? 2. now that I have this object infrastructure built up, what is the actual method call to get the theoretical value of the option? Thanks for your help! ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
On Wed, 2007-05-09 at 16:44 -0400, Jack Jones wrote:
> I'd like to calculate the Black-Scholes theoretical value of an > option. > > Here is the relevant setup (questions at bottom): > > //========================== > > // Underlying price > shared_ptr<SimpleQuote> > underlyingPrice(new SimpleQuote(stockPrice)); > > // Dividend term structure > shared_ptr<YieldTermStructure> > dividendTS(new FlatForward(expiryDate, > dividend, > Actual360())); This is not correct. The first argument to FlatForward should be the evaluation date, or rather the date for which the discount equals 1. This might be today's date, or a couple of days later if settlement days should be considered. The same applies to the interest-rate and volatility term structures. The rest of the setup is correct. > I have two questions: > > 1. what does the "price" argument to option.impliedVolatility() > represent? Given an option, and once you have fixed dividend yield and risk-free rate, you can find the price for a given volatility, or the other way around. impliedVolatility(price) is the latter calculation; given a target price, it returns the value of the volatility which causes the option to have such a price. > 2. now that I have this object infrastructure built up, what is the > actual method call to get the theoretical value of the option? option.NPV() Later, Luigi ---------------------------------------- Don't let school get in the way of your education. -- Mark Twain ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
> "or a couple of days later if settlement days should be considered"
Could you give an example to illustrate this phrase? What would the discount be between today and the day "a couple of days later"? Thanks in advance. Jia Luigi Ballabio <luigi.ballabio@g mail.com> To Sent by: Jack Jones quantlib-users-bo <[hidden email]> [hidden email] cc eforge.net [hidden email] t Subject 10/05/2007 08:10 Re: [Quantlib-users] Black-Scholes theoretical value On Wed, 2007-05-09 at 16:44 -0400, Jack Jones wrote: > I'd like to calculate the Black-Scholes theoretical value of an > option. > > Here is the relevant setup (questions at bottom): > > //========================== > > // Underlying price > shared_ptr<SimpleQuote> > underlyingPrice(new SimpleQuote(stockPrice)); > > // Dividend term structure > shared_ptr<YieldTermStructure> > dividendTS(new FlatForward(expiryDate, > dividend, > Actual360())); This is not correct. The first argument to FlatForward should be the evaluation date, or rather the date for which the discount equals 1. This might be today's date, or a couple of days later if settlement days should be considered. The same applies to the interest-rate and volatility term structures. The rest of the setup is correct. > I have two questions: > > 1. what does the "price" argument to option.impliedVolatility() > represent? Given an option, and once you have fixed dividend yield and risk-free rate, you can find the price for a given volatility, or the other way around. impliedVolatility(price) is the latter calculation; given a target price, it returns the value of the volatility which causes the option to have such a price. > 2. now that I have this object infrastructure built up, what is the > actual method call to get the theoretical value of the option? option.NPV() Later, Luigi ---------------------------------------- Don't let school get in the way of your education. -- Mark Twain ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users ********************************************************************* This communication contains confidential information, some or all of which may be privileged. It is for the intended recipient only and others must not disclose, distribute, copy, print or rely on this communication. If an addressing or transmission error has misdirected this communication, please notify the sender by replying to this e-mail and then delete the e-mail. E-mail sent to EDF Trading may be monitored by the company. Thank you. EDF Trading Markets Limited 71 High Holborn, London WC1V 6ED A Company registered in England No. 4255974. Switchboard: 020 7061 4000 EDF Trading Markets Limited is a member of the EDF Trading Limited Group and is authorised and regulated by the Financial Services Authority. VAT number: 735 5479 07 ********************************************************************* ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by Luigi Ballabio
Thanks Luigi, that is very helpful! A follow-up questions:
On 5/10/07, Luigi Ballabio <[hidden email]> wrote:
> // Dividend term structure Okay, I had assumed referenceDate was relative to QuantLib::Settings::instance().evaluationDate(). I suppose the expiry is taken into account through the exercise? ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
On Thu, 2007-05-10 at 11:05 -0400, Jack Jones wrote:
> Thanks Luigi, that is very helpful! A follow-up questions: > [...] > I had assumed referenceDate was relative to > QuantLib::Settings::instance().evaluationDate(). I suppose the expiry > is taken into account through the exercise? Yes, it is. Later, Luigi ---------------------------------------- An ideal world is left as an exercise to the reader. -- Paul Graham ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by Jia.Li
On Thu, 2007-05-10 at 09:19 +0100, [hidden email] wrote:
> > "or a couple of days later if settlement days should be considered" > > Could you give an example to illustrate this phrase? Yes, I wasn't very clear. And think of it, it's likely that what I wrote didn't apply even apply to this case... I wrote out of habit, having worked mostly in interest-rate derivatives. For such instruments (e.g., deposits or swaps) it is usually the case (at least in Euroland) that all instruments have a couple of days of settlement. Since all "today's" payments will actually occur two business days from today, it is sometimes the custom that such two days are skipped entirely, and the discount factor is set to 1.0 at the settlement date---two business day from today's date. In this setting, there's no discount at all between today and the settlement date, since those days are modeled out of existence. But for equity options, the whole thing is probably moot and the reference date should probably be today's date. I'll leave the answer to someone more experienced... Later, Luigi ---------------------------------------- Harrison's Postulate: For every action, there is an equal and opposite criticism. ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |