opinions on additional calc functions

tino ttk448 at gmail.com
Wed Nov 28 03:45:50 PST 2012


I'm new to libreoffice dev and I'm working on implementing some
additional financial (option pricing) functions for calc. So far I've


locally to add my functions but I've been told scaddins is mainly for
ms excel functions and ./core/sc/ is certainly not the right place. So
I'd need some advice where to place the new functions.
Also, any opinions on naming and parameter inputs are welcome.

The functions in question return prices and greeks (partial
derivatives of the price to certain input values) of some basic
financial options, all using the classic Black-Scholes model.

OPT_BS(...):      option price of a put/call option
OPT_DIGITAL(...): option price of a digital/binary option
OPT_BARRIER(...): barrier options (=put/call with barriers)
OPT_TOUCH(...):   touch/no-touch options (=digitals with barriers)

I've modelled the names on what is implemented in Gnumeric which has a
range of opt_foo(...) functions.

As for parameters they are mainly of double type but some are of enum
type. The enums could be mapped to integers but I've a slight
preference for STRING inputs but not sure how that is viewed here with
regard to localisation? E.g. I'm currently using "p" to specify a put
and "c" for a call, and "i" for in, "o" for out, and "delta" for delta
(d/dS), "gamma" for gamma (d^2/dS^2), etc.

I've attached a code snipped of OPT_BARRIER(...) interface

Cheers, Tino

-------------- next part --------------
A non-text attachment was scrubbed...
Name: financial.cxx
Type: text/x-c++src
Size: 3289 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20121128/719501ea/attachment.cxx>

More information about the LibreOffice mailing list