Book Image

Python for Finance

By : Yuxing Yan
Book Image

Python for Finance

By: Yuxing Yan

Overview of this book

A hands-on guide with easy-to-follow examples to help you learn about option theory, quantitative finance, financial modeling, and time series using Python. Python for Finance is perfect for graduate students, practitioners, and application developers who wish to learn how to utilize Python to handle their financial needs. Basic knowledge of Python will be helpful but knowledge of programming is necessary.
Table of Contents (14 chapters)
13
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 (Greek letters for options) is defined as the derivative of the option to its underlying security price. The delta of a call is defined as follows:

Greek letters for options

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:

Greek letters for options

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...