10.12.2019 Views

Python for Finance

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Options and Futures

Note that in the table,

Obviously, very few people can remember these formulae. Here is a very simple

approach, based on their definition:

How to remember?

Table 10.2 A simple approach to estimating Greek letters

• Delta: First order derivative

• Gamma: Second order derivative

• Theta: Time (T)

• Vega: Volatility (V)

• Rho: Rate (R)

For example, based on delta's definition, we know that it is the ratio of c2 - c1 and

s2 - s1. Thus, we could generate a small number to generate those two pairs; see

the following codes:

from scipy import log,exp,sqrt,stats

tiny=1e-9

S=40

X=40

T=0.5

r=0.01

sigma=0.2

def bsCall(S,X,T,r,sigma):

[ 358 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!