Login  Register

Re: QuEP 5

Posted by Luigi Ballabio-2 on Aug 14, 2002; 8:30am
URL: http://quantlib.414.s1.nabble.com/QuEP-5-tp2126p2127.html

Hi Vadim,
         I haven't much time, but here's the beginning of an answer:

At 02:50 AM 8/14/02 -0500, Vadim Ogranovich wrote:
>I am not sure that option specification parameters, e.g. put/call, exercise
>style, strike, expiration date should be part of a pricing engine. These are
>intrinsic properties of a traded instrument and are independent of the
>theoretical framework used to price the option.

By all means. In fact, this is how the current implementation works.
I guess my fault was not to add the slots for strike etc. to the
ConcreteOption box in the quep. However, here's how I intended it:
- the option keeps its arguments (strike, exercise date, whatever);
- when he option needs to be priced, it takes the parameters, possibly
   converting them (e.g., exercise date -> residual time) and stores them in
   the pricing engine;
- having been fed the arguments, the pricing engine crunches them and stores
   the results in its, well, results.
- the option takes the results back from the engine.

What might be confusing is the presence of the Arguments instance inside
the engine. It's not intended as an ownership thing, but only as a way to
pass any number and type of parameters to the engine.
In short,

     Arguments* args = engine->arguments();
     ... /* store argument values into args */
     engine->calculate();
     Results* res = engine->results();
     ... /* read them */

is just a more flexible (type-wise) way to write:

     Arguments* args = new (what? and who owns the pointer?);
     ... /* store argument values into args */
     Results* res = new (what? and who owns the pointer?);
     engine->calculate(args,res);
     ... /* read them */


>My understanding is that the QuEP is (at least partially) implemented. Could
>someone point me to the files? (The  ql/Pricers/europeanengine.hpp file
>mentioned in the QuEP doesn't exist)

ql/option.[c|h]pp
ql/pricingengine.hpp
ql/Instruments/*vanillaoption.[c|h]pp
ql/PricingEngines/*engine.[c|h]pp


>In the end let me ask a general question probably stemming from the lack of
>understanding of the purpose of the Instrument class. Suppose I have a book
>(portfolio) of stocks and options that I carry from day to day and all I
>need to do is to compute end of day PnL based on closing prices of the
>securities, their dividends, and option exercise (if any). How does QL help
>me do this? I thought I'd just need to sum the NAV-s of all securities, but
>it seems like NAV is more like a "theoretical" value rather than the market
>price.

Yes, it is the calculated price. For quoted instruments, you might be
better off simulating them with Instruments::Stock. But we'll have to go
into this.

Bye for now,
                 Luigi