Thursday, April 17, 2014

Python and QuantLib - American Equity Options

[The previous post in this series is here]

American options are exactly the same as European options in every respect, except of course, the holder of an American option can exercise his right to buy or sell stock earlier than the expiry date.

On the face of it, this extra freedom in the contract sounds like a big benefit.  Extra choice is always good.

In practice however, the dollar value of the benefit is minimal.

American bankers (North or South?) are great sales people.  They sell some fancy financial products which sound much better value than it really is.  Where have I heard that before?  Ingenious.

The benefit might be near worthless but after the tweak there is no analytical solution to the problem.  I.e. no best 'answer' in all situations.
If the expiry date is finite, the problem is associated with a 2-dimensional free-boundary problem with no known closed-form solution.
Luckily QuantLib provides a couple of dozen pricing engines that numerically approximate solutions; which means if you really care about accuracy you have a lot of ammunition to nail down decent numbers.

On the other hand, if you really don't care too much, I hear you!

It takes two lines of code to change our previous European option into an American option.

First we need to change the exercise rules to allow for early expiry.

Our exercise variable in the European option example
exercise = EuropeanExercise(expiry_date)  
becomes
exercise = AmericanExercise(valuation_date, expiry_date)
Now we have to look into which pricing engine to use.

Cox, Ross and Rubinstein is the bog standard method that everyone uses and understands well but unfortunately is also terribly inefficient.

I have found that the finite difference engine generally achieves far better accuracy within a similar time period.

We switch out the European analytical engine
engine = AnalyticEuropeanEngine(process)
with our brand spanking new one
time_steps = 100
grid_points = 100
engine = FDAmericanEngine(process, time_steps, grid_points)
Once we have everything good to go and see results we will notice far fewer analytics available.  We have left the analytical world and almost every sensitivity calculation no longer comes for free.  I.e. now we will have to recalculate by shocking inputs a little in order to see each Greek.

The full source code for the example is here.  Note that I have started to organise the code into methods.

So there you have it.  Bank salesmen in America threw a nice sweetener into the option deal causing headaches for practitioners (and grant money for mathematicians) for decades to come.

Now we will just have to wait for African (?) equity option salesmen to popularise American options that never expire to make our lives easier again.

[Next post]

1 comment:

Unknown said...

This explains the history behind American and European terminology: http://quant.stackexchange.com/questions/11103/why-are-options-called-what-they-are-called