The last kata threw open the meaning of quantitative finance. Ironically, if quant finance is about quantifying, it is rarely if ever about quantifying dollars!
It's about quantifying the metaphysical.
Perhaps that's fitting, because the future is always metaphysical to some degree (unless you're a physicist).
The past is completely deterministic however.
There is no ambiguity in contracts that have matured or expired. The terms of the contracts are crystal clear.
K is the delivery price and
S the spot price, our forward is set to be the difference of these two values at the maturity or delivery date
F(T) = S(T) - K
A child can calculate this, the difficulties arise when
T is in the future and we occupy
And this is the same with the second of the two types of securities in finance.
(Yes there are really only two fundamental security types in finance)
Options give the holder the right to buy or sell an asset at some time in the future, for an agreed upon price.
Forwards are not optional, you must buy or sell the asset at maturity.
Therefore the equation for call options (the right to buy an asset) in pseudo code is,
C(T) = max( S(T) - K, 0 )
Put options, or the right to sell, look like so,
P(T) = max( K - S(T), 0 )
Following from kata 005, use matplotlib only with lambdas to plot:
long and short forwards at time
Twith respect to changing spot prices
plot the forwards with respect to both changing spot prices and plug variables (e.g. dividend yield, as covered in the previous kata) at time
do the same for both call and put options at expiry time