Re: AW: Excel add in

Posted by Chak Jack Wong on
URL: http://quantlib.414.s1.nabble.com/bermudan-swaption-simplex-tp2377p2381.html

The typical way I have seen to handle the recalculation is by returning a
name+recalcnumber as the object on the spreadsheet.
Whenever the function is called, a new recalc-number is generated.  Hence we
only need to use the Excel dependency mechanism.

It is rather crude, but it has been working quite alright for me.  I have seen
better mechanism that uses a handle to remember changes its value.


Luigi Ballabio wrote:

> At 12:03 PM 2/5/03 +0100, Jens Thiel wrote:
> > > Do you think this will work and can provide a general automatic wrapper
> >for Excel?
> >
> >I could imagine that SWIG can be extended this way. C++ has been build on a
> >functional language (cfront to c), Python and Perl are functional languages
> >in their core. They all carry some kind of "this/self" ptr around, and
> >attach functions to "this". A stringified "this" could be possible, and
> >generating some mangled namespace_objecttype_methodname_overload functions
> >that take this string as their first parameter as well.
>
> Yes, this is what SWIG does already for Python---a string is passed to and
> fro which encodes 'this', i.e., the address of the object.
>
> >The problem I see here, is that a lot of code is going to be written in
> >spreadsheet cells, which is very hard to maintain.
>
> Which is the point I tried to make. My main concern with this
> "functionified object interface" is usability. You'll need a cell to call
> the constructor, and another to call the method you're interested in; and
> you'll have to find a way to trigger recalculations, which might be hard to
> maintain. For instance, if a market rate changes, any term structure using
> it will be notified, as well as any swaps which are discounted on the
> latter, so that the actual objects will be ready to recalculate their value
> when they are asked for it. But they won't have a way to notify
> Excel---they don't even *know* they're being used by Excel---so they will
> *not* be asked for their new price, unless you keep track of all
> dependencies on your spreadsheet...
>
> Bye,
>          Luigi

--
This is not an offer (or solicitation of an offer) to buy/sell the
securities/instruments mentioned or an official confirmation.  Morgan Stanley
may deal as principal in or own or act as market maker for
securities/instruments mentioned or may advise the issuers.  This may refer to a
research analyst/research report. Unless indicated, these views are the author's
and may differ from those of Morgan Stanley research or others in the Firm. We
do not represent this is accurate or complete and we may not update this.  Past
performance is not indicative of future returns. For additional information,
research reports and important disclosures, contact me or see
https://secure.ms.com.  You should not use email to request, authorize or effect
the purchase or sale of any security or instrument, to send transfer
instructions, or to effect any other transactions.  We cannot guarantee that any
such requests received via email will be processed in a timely manner.  This
communication is solely for the addressee(s) and may contain confidential
information.  We do not waive confidentiality by mistransmission.  Contact me if
you do not wish to receive these communications.  In the UK, this communication
is directed in the UK to those persons who are market counterparties or
intermediate customers (as defined in the UK Financial Services Authority's
rules).