• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

PSOR american call/put option implementation in C++, VBA or any languages

Does anyone have code (in any language) to implement the American put/call option pricing using PSOR described in Paul Wilmott's "The mathematics of financial derivatives" page 173?

Bastian Gross

German Mathquant
This site should be helpfully: Quantcode
I am a student in financial engineering and I have to find the matlab codes of american put option with monte carlo and asian call option with binomial tree. Can you help me? Can you write or show the link where I can find the codes?
I am in a similiar situation - need vba code for Asian option pricing using Binomial tree and monte carlo - any help would be much appriciated.
See Chapter 7 of "The Complete Guide to Option Pricing Formulas" by Espen Gaarder Haug (2nd Edition) for Hull White trinomial trees for Asian Option (the CD accompanies the book contains the VBA code).

See Chapter 26 of "Options, Futures, and other Derivatives" by John Hull (7th Edition) for Least Squares Monte Carlo implementation for American put option. Quantcode website should have some sample codes that you can borrow. It should not be too bad implementing this yourself if you are using Matlab.

Daniel Duffy

C++ author, trainer
The penalty method makes the PDE semilinear and this a term like f(V, epsilon). My experience is that you need a second-order scheme in time for the BS PDE part and that epsilon must be chosen with care. Are you using the standard penalty term f()?

And you need to decide how to do time integration as you now have a nonlinear term (implicit, semi-implicit etc.) See Nielssen JCF 2002. When semi-implicit, your delta_T is dependent on that epsilon. At code level, it means a modification of the code in the linear case.

Actually, I have found Brennan-Schwartz to be very good. I have documented some results here for my ADE scheme


ADE is fast (no LU stuff needed) and is easily parallelised.

If you are interested in comparing the different methods for early exercise then this might be interesting



Daniel Duffy

C++ author, trainer
Your'e welcome.
The nonlinear term is not too nasty so Newton should be Ok if you have a good start value.
I have found that Steffensen's method is also robust.

Daniel Duffy

C++ author, trainer
PSOR is iterative, which means it *can* be slow depending on the spectrum (eigenvalues) of A.

Just out of interest, did you try Brennan-Schwartz? It's fast and easy to implement.

is this the method from Nocedal?


Looking at the numbers, 2.1 secs is NOT fast. I vaguely remember ~0.2 seconds using ADE and Brennan Schwarz.

Some articles tend to have the adjective 'fast' as the first word in the title. Even if fast, it seems strange...

---------- Post added at 07:56 AM ---------- Previous post was at 07:46 AM ----------

Here is a post I made from another forum last year, hth

I have done a number of tests against published results and other methods (e.g. penalty). Until now, I reckon that ADE with domain transformation and with checking of the intrinsic value constraint is up there in the first few.

Example: CEV model with beta = 2/3.
machine is Window XP (Dell vostro 1710) hobby laptop 1.8 Ghz, 2GB RAM. Duo core (and I use them).
In release mode the ADE model prices to the penny (2, 3 decimal places) in interval [45, 130] milliseconds. Using OpenMP multithreading gives a speedup of roughly 60%.

The nice thing is I do not need to define any nonlinear penalty functions, front fixing or domain truncation tricks. These methods I tried were much slower.

I may have posted this article already, but here it is on SSRN (ADE methods and with early exercise as well).


Daniel Duffy

C++ author, trainer
I think that when you get into ADE it will not disappoint. It's kind of state-of-art and new even though it predates ADI and Splitting methods.