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

Greek letters for options


In the option theory, several Greek letters, usually called Greeks, are used to represent the sensitivity of the price of derivatives such as options to bring a change in the underlying security. Collectively, those Greek letters are also called the risk sensitivities, risk measures, or hedge parameters.

Delta () is defined as the derivative of the option to its underlying security price. The delta of a call is defined as follows:

We could design a hedge based on the delta value. The delta of a European call on a non-dividend-paying stock is defined as follows:

For example, if we write one call, we could buy delta number of shares of stocks so that a small change in the stock price is offset by the change in the short call. The definition of the delta_call() function is quite simple. Since it is included in the p4f.py file, we can call it easily, as shown in the following code:

>>>from p4f import *
>>>round(delta_call(40,40,1,0.1,0.2),4)
0.7257

The...