quantlib & Excel

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

quantlib & Excel

Vu Huynh
Hi Nando,
I got error while compiling cvs version of qlxl. The compiler complained about Functions being neither class nor namespace.
Can you upload file containing definition of Functions to cvs.
I used to work with Excel a lot. If you have any question or idea what workbook you want to create, I can help !
Ciao,
Vu
Reply | Threaded
Open this post in threaded view
|

Re: quantlib & Excel

Ferdinando M. Ametrano-2
Hi Vu

>I got error while compiling cvs version of qlxl. The compiler complained
>about Functions being neither class nor namespace.
>Can you upload file containing definition of Functions to cvs.
QuantLib-Excel does work with the current cvs version of QuantLib and xlw.
QuantLib 0.2.1, QuantLib 0.3.0a5, and xlw 1.0 are not OK

Check out QuantLib in the same way as you check out QuantLib-Excel.
To check out xlw please see http://xlw.sf.net/cvs.html

If you're using MS VC++ you will have to compile using the OnTheEdge
configurations.
Other compilers are out of luck since xlw does work only with MS VC++ (we
need help on this issue!!)

>I used to work with Excel a lot. If you have any question or idea what
>workbook you want to create, I can help !
thank you very much for your offer. If you're interested in getting cvs
write access please see
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/quantlib/QuantLib/dev_tools/newdeveloperintro.txt?rev=1.4

qlxl is very early stage: I'm mainly trying to export a few QuantLib
features as Excel addin, while familiarizing with xlw.

ciao -- Nando



Reply | Threaded
Open this post in threaded view
|

Re: quantlib & Excel

Vu Huynh
Hello Nando,

Please you give me developer access to CVS. My CVS account is vmhuynh .

I have a suggestion: we can make let say FinMath class with static pricing
method.
FinMath can be easily wrapped in XLW and can be used by Option Pricing
Engine too.

Rough sketch:

public class FinMath
{
    public static double blackscholes_option_price(double S, double X,
double sigma, double time, double r) {...}

    public static double binomial_option_price(double S, double X, double
sigma, double time, double r, int steps) {...}

    ....
}

public class BSOptionPricingEngine
{
    ...
    public double value() {
        double S = getUnderlyingPrice(), X=getStrike(), ...
        return FinMath.blackscholes_option_price( S, X, ...);
    }
    ...
}

porting to Excel C-API:

...
LPXLOPER EXCEL_EXPORT xl_blackscholes_option_price(XlfOper xlS, ....)
  {
    EXCEL_BEGIN;
    // Converts xlS to a double.
    double S=xlS.AsDouble(); .....
    ...
    double ret = FinMath.blackscholes_option_prices(S, ....);

    // Returns the result as a XlfOper.
    return XlfOper(ret);
    EXCEL_END;
  }
...

I haven't got new QuantLib CVS yet, but I guess that your Functions class
has to proceduralize the object-oriented OptionPricingEngine.

Ciao,
Vu~


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



Reply | Threaded
Open this post in threaded view
|

Re: quantlib & Excel

Luis Pereira-3
In reply to this post by Vu Huynh
Hi all,

I downloaded the c++ wrapper (http://www.ifrance.com/xlw/) which seems
exactly whar I need. I tryed to compile the test project with Visual C++ 6.0
with the stated options namely compile and link the dll in multi-threaded
mode, but I get
several errors like the below ones.

It´s probably the dependencies. I looked onto Project|Dependencies and I do
not have any dependences.
How can I include Excel32.lib as a dependence?

Thanks in advance,
Luís Pereira

main.obj : error LNK2001: unresolved external symbol "public: __thiscall
XlfOper::~XlfOper(void)" (??1XlfOper@@QAE@XZ)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall
XlfOper::operator struct xloper *(void)" (??BXlfOper@@QAEPAUxloper@@XZ)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall
XlfOper::XlfOper(double)" (??0XlfOper@@QAE@N@Z)
main.obj : error LNK2001: unresolved external symbol "public: double
__thiscall XlfOper::AsDouble(void)const " (?AsDouble@XlfOper@@QBENXZ)
main.obj : error LNK2001: unresolved external symbol "public: void
__thiscall XlfExcel::FreeMemory(void)" (?FreeMemory@XlfExcel@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: static class
XlfExcel & __cdecl XlfExcel::Instance(void)" (?Instance@XlfExcel@@SAAAV1@XZ)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall
XlfOper::XlfOper(char const *)" (??0XlfOper@@QAE@PBD@Z)
main.obj : error LNK2001: unresolved external symbol "public: char *
__thiscall XlfOper::AsString(void)const " (?AsString@XlfOper@@QBEPADXZ)
main.obj : error LNK2001: unresolved external symbol "public: class XlfOper
__thiscall XlfRef::operator()(unsigned short,unsigned char)const "
(??RXlfRef@@QBE?AVXlfOper@@GE@Z)
main.obj : error LNK2001: unresolved external symbol "public: unsigned char
__thiscall XlfRef::GetNbCols(void)const " (?GetNbCols@XlfRef@@QBEEXZ)
main.obj : error LNK2001: unresolved external symbol "public: unsigned short
__thiscall XlfRef::GetNbRows(void)const " (?GetNbRows@XlfRef@@QBEGXZ)
main.obj : error LNK2001: unresolved external symbol "public: class XlfRef
__thiscall XlfOper::AsRef(void)const " (?AsRef@XlfOper@@QBE?AVXlfRef@@XZ)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall
XlfArgDesc::~XlfArgDesc(void)" (??1XlfArgDesc@@QAE@XZ)
main.obj : error LNK2001: unresolved external symbol "public: virtual
__thiscall XlfFuncDesc::~XlfFuncDesc(void)" (??1XlfFuncDesc@@UAE@XZ)
main.obj : error LNK2001: unresolved external symbol "class XlfArgDescList
__cdecl operator+(class XlfArgDesc const &,class XlfArgDesc const &)"
(??H@YA?AVXlfArgDescList@@ABVXlfArgDesc@@0@Z)
main.obj : error LNK2001: unresolved external symbol "public: void
__thiscall XlfAbstractCmdDesc::Register(void)const "
(?Register@XlfAbstractCmdDesc@@QBEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void
__thiscall XlfFuncDesc::SetArguments(class XlfArgDescList const &)"
(?SetArguments@XlfFuncDesc@@QAEXABVXlfArgDescList@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall
XlfArgDescList::XlfArgDescList(class XlfArgDesc const &)"
(??0XlfArgDescList@@QAE@ABVXlfArgDesc@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall
XlfFuncDesc::XlfFuncDesc(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &,class
std::basic_string<char,struct std::char_traits<ch
ar>,class std::allocator<char> > const &,class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &,class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)" (??0XlfFuncDes
c@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@000@Z
)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall
XlfArgDesc::XlfArgDesc(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &,class
std::basic_string<char,struct std::char_traits<char
>,class std::allocator<char> > const &,char)"
(??0XlfArgDesc@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@
2@@std@@0D@Z)
main.obj : error LNK2001: unresolved external symbol "public: void
__thiscall XlfExcel::SendMessageA(char const *)"
(?SendMessageA@XlfExcel@@QAEXPBD@Z)
main.obj : error LNK2001: unresolved external symbol "private: void
__thiscall XlfOper::Allocate(void)" (?Allocate@XlfOper@@AAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: char *
__thiscall XlfExcel::GetMemory(int)" (?GetMemory@XlfExcel@@QAEPADH@Z)
Debug/test.xll : fatal error LNK1120: 23 unresolved externals
Error executing link.exe.

test.xll - 24 error(s), 0 warning(s)


Reply | Threaded
Open this post in threaded view
|

Re: quantlib & Excel

Vu Huynh
Hi,

first you should change Excel32.lib to xlw.lib in file confing.msvc.h in
project xlw.

#ifdef _DEBUG
    #pragma comment(lib,"xlwd.lib")
#else
    #pragma comment(lib,"xlw.lib")
#endif

And then change preprocessor definition EXCEL32_NOIMPORTEXPORT to
XLW_NOIMPORTEXPORT in project QuantLibExcel setting (in C/C++ -> General
tab).

Cheers,
Vu

----- Original Message -----
From: "Luis Pereira" <[hidden email]>
To: <[hidden email]>
Sent: Monday, March 18, 2002 1:48 AM
Subject: Re: [Quantlib-users] quantlib & Excel


Hi all,

I downloaded the c++ wrapper (http://www.ifrance.com/xlw/) which seems
exactly whar I need. I tryed to compile the test project with Visual C++ 6.0
with the stated options namely compile and link the dll in multi-threaded
mode, but I get
several errors like the below ones.

It´s probably the dependencies. I looked onto Project|Dependencies and I do
not have any dependences.
How can I include Excel32.lib as a dependence?

Thanks in advance,
Luís Pereira

main.obj : error LNK2001: unresolved external symbol "public: __thiscall
XlfOper::~XlfOper(void)" (??1XlfOper@@QAE@XZ)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall
XlfOper::operator struct xloper *(void)" (??BXlfOper@@QAEPAUxloper@@XZ)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall
XlfOper::XlfOper(double)" (??0XlfOper@@QAE@N@Z)
main.obj : error LNK2001: unresolved external symbol "public: double
__thiscall XlfOper::AsDouble(void)const " (?AsDouble@XlfOper@@QBENXZ)
main.obj : error LNK2001: unresolved external symbol "public: void
__thiscall XlfExcel::FreeMemory(void)" (?FreeMemory@XlfExcel@@QAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: static class
XlfExcel & __cdecl XlfExcel::Instance(void)" (?Instance@XlfExcel@@SAAAV1@XZ)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall
XlfOper::XlfOper(char const *)" (??0XlfOper@@QAE@PBD@Z)
main.obj : error LNK2001: unresolved external symbol "public: char *
__thiscall XlfOper::AsString(void)const " (?AsString@XlfOper@@QBEPADXZ)
main.obj : error LNK2001: unresolved external symbol "public: class XlfOper
__thiscall XlfRef::operator()(unsigned short,unsigned char)const "
(??RXlfRef@@QBE?AVXlfOper@@GE@Z)
main.obj : error LNK2001: unresolved external symbol "public: unsigned char
__thiscall XlfRef::GetNbCols(void)const " (?GetNbCols@XlfRef@@QBEEXZ)
main.obj : error LNK2001: unresolved external symbol "public: unsigned short
__thiscall XlfRef::GetNbRows(void)const " (?GetNbRows@XlfRef@@QBEGXZ)
main.obj : error LNK2001: unresolved external symbol "public: class XlfRef
__thiscall XlfOper::AsRef(void)const " (?AsRef@XlfOper@@QBE?AVXlfRef@@XZ)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall
XlfArgDesc::~XlfArgDesc(void)" (??1XlfArgDesc@@QAE@XZ)
main.obj : error LNK2001: unresolved external symbol "public: virtual
__thiscall XlfFuncDesc::~XlfFuncDesc(void)" (??1XlfFuncDesc@@UAE@XZ)
main.obj : error LNK2001: unresolved external symbol "class XlfArgDescList
__cdecl operator+(class XlfArgDesc const &,class XlfArgDesc const &)"
(??H@YA?AVXlfArgDescList@@ABVXlfArgDesc@@0@Z)
main.obj : error LNK2001: unresolved external symbol "public: void
__thiscall XlfAbstractCmdDesc::Register(void)const "
(?Register@XlfAbstractCmdDesc@@QBEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: void
__thiscall XlfFuncDesc::SetArguments(class XlfArgDescList const &)"
(?SetArguments@XlfFuncDesc@@QAEXABVXlfArgDescList@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall
XlfArgDescList::XlfArgDescList(class XlfArgDesc const &)"
(??0XlfArgDescList@@QAE@ABVXlfArgDesc@@@Z)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall
XlfFuncDesc::XlfFuncDesc(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &,class
std::basic_string<char,struct std::char_traits<ch
ar>,class std::allocator<char> > const &,class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &,class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)" (??0XlfFuncDes
c@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@000@Z
)
main.obj : error LNK2001: unresolved external symbol "public: __thiscall
XlfArgDesc::XlfArgDesc(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &,class
std::basic_string<char,struct std::char_traits<char
>,class std::allocator<char> > const &,char)"
(??0XlfArgDesc@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@
2@@std@@0D@Z)
main.obj : error LNK2001: unresolved external symbol "public: void
__thiscall XlfExcel::SendMessageA(char const *)"
(?SendMessageA@XlfExcel@@QAEXPBD@Z)
main.obj : error LNK2001: unresolved external symbol "private: void
__thiscall XlfOper::Allocate(void)" (?Allocate@XlfOper@@AAEXXZ)
main.obj : error LNK2001: unresolved external symbol "public: char *
__thiscall XlfExcel::GetMemory(int)" (?GetMemory@XlfExcel@@QAEPADH@Z)
Debug/test.xll : fatal error LNK1120: 23 unresolved externals
Error executing link.exe.

test.xll - 24 error(s), 0 warning(s)

_______________________________________________
Quantlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



Reply | Threaded
Open this post in threaded view
|

xlw and QuantLib

Ferdinando M. Ametrano-2
Hi all

sorry for the silence, but I had 2 hard days.
Luis, Vu: I'm sorry you had trouble with the CVS version of
xlw/quantlib/quantlib-excel: I made some partial commit.

Anyway you can now download the latest XLW build at
http://xlw.sourceforge.net/snapshot.html. This build is performed using the
current CVS snapshot on a weekly basis at least.

This version 1.1.0a1 has all the modification I did to xlw (see
http://cvs.sf.net/cgi-bin/viewcvs.cgi/xlw/xlw/NEWS.TXT?rev=HEAD&content-type=text/vnd.viewcvs-markup)
and as far as I'm concerned it's a 1.1 release candidate.

Please report any problem you might have.

I know some people are looking at quantlib-excel and quantlib-excel depends
on xlw, but as soon as things settle down please use [hidden email]
for xlw messages that are not of QuantLib interest

thank you everybody

ciao -- Nando