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

Exercises


1. Write a Python program to price a call option.

2. Explain the empty shell method that is used while writing a complex Python program.

3. Explain the logic behind the so-called comment-all-out method when writing a complex Python program.

4. Explain the usage of a return value when we debug a program.

5. When we write the CND, we could define a1, a2, a3, a4, and a5 separately. What are the differences between the following two approaches?

Current approach:

(a1,a2,a3,a4,a5)=(0.31938153,-0.356563782,1.781477937,-1.821255978,1.330274429)

An alternative approach:

a1=0.31938153
a2=-0.356563782
a3=1.781477937
a4=-1.821255978
a5=1.330274429

6. What are the definitions of effective annual rate, effect semi-annual rate, and risk-free rate for the call option model? Assuming that the current annual risk-free rate is 5 percent, compounded semi-annually, which value should we use as our input value for the Black-Scholes call option model?

7. What is the call premium when the stock is traded at...