SingleAssetOption::setUnderlying needed

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

SingleAssetOption::setUnderlying needed

Vadim Ogranovich-3
Sorry, my previous message had a wrong subject line. Please disregard. Here
is a correct one. Thanks, Vadim

Hi,

I seem to need a method to set underlying on a SingleAssetOption.
Unfortunately, there is no such method (a complete list of available
modifiers is given below)
            // modifiers
            virtual void setVolatility(double newVolatility) ;
            virtual void setRiskFreeRate(Rate newRate) ;
            virtual void setDividendYield(Rate newDividendYield) ;

In this respect I have a couple of questions:
1. What was the criteria for deciding which set methods should be
implemented?
2. Why the methods are virtual? I looked at the default implementation of
setVolatility() and found it more than adequate.

        void SingleAssetOption::setVolatility(double volatility) {
                // ... some code is striped ...
            volatility_ = volatility;
            hasBeenCalculated_ = false;
        }

I noticed that EuropeanOption overloads setVolatility(), but this doesn't
make sense to me; hasBeenCalculated_ = false should be good enough to
invalidate the cache. Am I missing anything?

        void EuropeanOption::setVolatility(double newVolatility) {
            SingleAssetOption::setVolatility(newVolatility);
            D1_ = D2_ = alpha_ = beta_ = NID1_ = Null<double>();
            standardDeviation_ = Null<double>();
        }

Thanks, Vadim

--------------------------------------------------
DISCLAIMER
This e-mail, and any attachments thereto, is intended only for use by the
addressee(s) named herein and may contain legally privileged and/or
confidential information.  If you are not the intended recipient of this
e-mail, you are hereby notified that any dissemination, distribution or
copying of this e-mail, and any attachments thereto, is strictly prohibited.
If you have received this e-mail in error, please immediately notify me and
permanently delete the original and any copy of any e-mail and any printout
thereof.

E-mail transmission cannot be guaranteed to be secure or error-free.  The
sender therefore does not accept liability for any errors or omissions in
the contents of this message which arise as a result of e-mail transmission.

NOTICE REGARDING PRIVACY AND CONFIDENTIALITY

Knight Trading Group may, at its discretion, monitor and review the content
of all e-mail communications.



Reply | Threaded
Open this post in threaded view
|

Re: SingleAssetOption::setUnderlying needed

Rod Pienaar
Vadim

<Vadim Wrote>I seem to need a method to set underlying on a SingleAssetOption.
Unfortunately, there is no such method.
I had exactly the same thoughts.  I get around this by constructing a new option with new attribute values each time they change.  Its not the most efficient way of doing things and additional get/set methods would be useful.

<Vadim Wrote>Why the methods are virtual? I looked at the default implementation of
setVolatility() and found it more than adequate.
The method may be adequate but what if a developer wants to provide a sub-class of single asset option and also provide his own implementation?  If the method were not declared virtual he might get some unexpected behaviour when in fact he wanted it to behave polymorphically.  The class is just future proofing itself.


Regs
Rod




--

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.




Reply | Threaded
Open this post in threaded view
|

Re: SingleAssetOption::setUnderlying needed

Luigi Ballabio-4
At 09:42 AM 4/24/02 +0100, Rod Pienaar wrote:
><Vadim Wrote>I seem to need a method to set underlying on a SingleAssetOption.
>Unfortunately, there is no such method.
>I had exactly the same thoughts.  I get around this by constructing a new
>option with new attribute values each time they change.  Its not the most
>efficient way of doing things and additional get/set methods would be useful.

I know. The sad story is, I didn't looked that hard at SingleAssetOption
since it would be superseded by QuEP 5 (in the new framework, you would
pass the underlying as a market element. The option would register as an
observer and react to changes in the market element value.) Then, I haven't
had time to go ahead and implement QuEP 5...
In the meantime, feel free to add a setUnderlying to SingleAssetOption if
you need it. The reason it's not there is just that we hadn't needed it yet.

Bye,
         Luigi