Pricing volatility surface fast

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

Pricing volatility surface fast

ivanf1
Hi,

I have taken the EquityOption example that comes with QL and modified it to just use the FiniteDifference code. I have also added code so that it handles discreet dividends.

My question is, I am naively pricing the whole term structure and smirk by using a for loop and changing the strike/payoff/maturity.

Is there a function that just takes a payoff vector, a maturity vecotr,  a dividend vector, etc and returns the price for all the options on the volatility surface?

Alternatively, I have tried to run each of the aformentioned calls in the for loop by using paralle_for code using OpenMP, but the boost libraries bomb. Is Boost/QuantLib thread-safe?

I would be grateful for any direction in pricing many many equity options with discreet dividends __fast__.

Thank You,

Ivan
Reply | Threaded
Open this post in threaded view
|

ql/cashflows/cashflows.cpp compile error

Sun, Xiuxin
HI all,
a compile error 'Error: Different types for "?:"
(QuantLib::Settings::DateProxy& and const QuantLib::Date&).'
at         Date d = (refDate==Date() ?
                     Settings::instance().evaluationDate() :
                     refDate);
I find that return type from Settings::instance().evaluationDate() is
DateProxy and different from Date, could someone give a clue ?
thanks,
sun

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ql/cashflows/cashflows.cpp compile error

Luigi Ballabio
On Tue, 2008-07-29 at 17:58 +0800, Sun, Xiuxin wrote:
> a compile error 'Error: Different types for "?:"
> (QuantLib::Settings::DateProxy& and const QuantLib::Date&).'
> at         Date d = (refDate==Date() ?
>                      Settings::instance().evaluationDate() :
>                      refDate);
> I find that return type from Settings::instance().evaluationDate() is
> DateProxy and different from Date, could someone give a clue ?

What compiler? It works with all common ones as DateProxy is implicitly
convertible to Date...

Luigi


--

These are my principles, and if you don't like them... Well, I have
others.
-- Groucho Marx



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ql/cashflows/cashflows.cpp compile error

Sun, Xiuxin
Version : Sun C++ 5.7 it this version too old for QuantLib ?
 

-----Original Message-----
From: Luigi Ballabio [mailto:[hidden email]]
Sent: Tuesday, July 29, 2008 6:10 PM
To: Sun, Xiuxin [CMB-IT]
Cc: [hidden email]
Subject: Re: [Quantlib-users] ql/cashflows/cashflows.cpp compile error

On Tue, 2008-07-29 at 17:58 +0800, Sun, Xiuxin wrote:
> a compile error 'Error: Different types for "?:"
> (QuantLib::Settings::DateProxy& and const QuantLib::Date&).'
> at         Date d = (refDate==Date() ?
>                      Settings::instance().evaluationDate() :
>                      refDate);
> I find that return type from Settings::instance().evaluationDate() is
> DateProxy and different from Date, could someone give a clue ?

What compiler? It works with all common ones as DateProxy is implicitly
convertible to Date...

Luigi


--

These are my principles, and if you don't like them... Well, I have
others.
-- Groucho Marx



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ql/cashflows/cashflows.cpp compile error

Luigi Ballabio
On Tue, 2008-07-29 at 18:15 +0800, Sun, Xiuxin wrote:
> Version : Sun C++ 5.7 it this version too old for QuantLib ?

I don't know. Anyway, you should get it to work by replacing 'refDate'
with 'Date(refDate)'.

Luigi


--

I have yet to see any problem, however complicated, which, when you
looked at it in the right way, did not become still more complicated.
-- Poul Anderson



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ql/cashflows/cashflows.cpp compile error

Simon Ibbotson
As it's a typecast operator on the DateProxy class, not a constructor on the Date class, should that read     (Date)refDate    instead?



On Tue, Jul 29, 2008 at 12:33 PM, Luigi Ballabio <[hidden email]> wrote:
On Tue, 2008-07-29 at 18:15 +0800, Sun, Xiuxin wrote:
> Version : Sun C++ 5.7 it this version too old for QuantLib ?

I don't know. Anyway, you should get it to work by replacing 'refDate'
with 'Date(refDate)'.

Luigi


--

I have yet to see any problem, however complicated, which, when you
looked at it in the right way, did not become still more complicated.
-- Poul Anderson



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: ql/cashflows/cashflows.cpp compile error

Luigi Ballabio
On Tue, 2008-07-29 at 12:47 +0100, Simon Ibbotson wrote:
> As it's a typecast operator on the DateProxy class, not a constructor
> on the Date class, should that read     (Date)refDate    instead?

Same thing.

Luigi


--

The first rule of intelligent tinkering is to save all the parts.
-- Paul Erlich



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users