Book Image

Python for Finance

By : Yuxing Yan
Book Image

Python for Finance

By: Yuxing Yan

Overview of this book

Table of Contents (20 chapters)
Python for Finance
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

European options with known dividends


Assume that we have a known dividend d distributed at time T1, T1 < T, where T is our maturity date. We can modify the original Black-Scholes-Merton option model by replacing S0 with S, where:

In the previously discussed example, if we have a known dividend of $1.5 delivered in one month, what is the price of the call?. The price is calculated as follows:

>>>import p4f
>>>s0=40
>>>d=1.5
>>>r=0.015
>>>T=6/12
>>>s=s0-exp(-r*T*d)
>>>x=42
>>>sigma=0.2 
>>>round(p4f.bs_call(s,x,T,r,sigma),2)
1.18

The first line of the program imports the p4f module, which contains the call option model. The result shows that the price of the call is $1.18, which is lower than the previous value ($1.56). It is understandable since the price of the underlying stock would drop roughly by $1.5 in one month. Because of this, the chance that we could exercise our call option will be less, that is...