Quantcast
Channel: CodeSection,代码区,Python开发技术文章_教程 - CodeSec
Viewing all articles
Browse latest Browse all 9596

Option Calculus - 012 - Pure, Functional, Financial, Python Katas

$
0
0

We introduced the only two fundamental securities in finance over the last two katas, and now we are going to again tell you we were not being 100% truthful.

There is only one fundamental type of security.

Just as the lambda calculus tells us we can calculate anything with a a mere lambda, we can boil everything in finance down to options.

Options are fundamental building blocks.

Understand options and you can put your feet up and sip Pina Coladas for the rest of the day.

As we showed yesterday. A forward can be represented like this,

F(T) = S(T) - K

where T is the maturity date.

K the delivery price or price of the asset at T .

S the 'spot' price of the asset.

A Call option, or the right to buy an asset at time T is,

C(T) = max(S(T) - K, 0)

The right to sell, or a put is,

P(T) = max( -S(T) + k, 0)

Refer back to the diagrams we plotted yesterday.

If an asset price is below the K or strike we have a positively valued put, and the other way around for the call.

Now, let's short the put,

-P(T) = -max( -S(T) + K, 0) a

This means the best we can do is break even, otherwise if the asset price is less than the strike, we lose money.

If you map a call and a put together with the same strike, expiry and underlying asset, it will look exactly like a future.

F(T) = C(T) - P(T)

This is called put call parity.

It is the most certain thing in quantitative finance. It is unbreakable.

The exercise today is to look at real world Put-Call parity by using real stock option prices and comparing them to the compounded value of the current stock spot price to the expiry date.

Find option prices here .

Or use this script to download option data.

E.g.

Options('goog')

downloads Google stock option prices.


Viewing all articles
Browse latest Browse all 9596

Trending Articles