-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathplot.py
60 lines (54 loc) · 1.72 KB
/
plot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from # import #
import matplotlib.pyplot as plt
god = 365
class Plot(#):
def plotPL(self, bePriceS, bePriceF, params, exp, step):
bePrice = []
i = bePriceS
while i <= bePriceF:
bePrice.append(i)
i+=step
P_L = []
for s in bePrice:
P_L.append(self.p_l(s, params, exp))
plt.plot(bePrice, P_L, label=int(exp*god))
def plotDelta(self, bePriceS, bePriceF, params, exp, step):
bePrice = []
i = bePriceS
while i <= bePriceF:
bePrice.append(i)
i+=step
D = []
for s in bePrice:
D.append(self.deltaFull(s, params, exp))
plt.plot(bePrice, D, label=int(exp*god))
def plotTheta(self, bePriceS, bePriceF, params, exp, step):
bePrice = []
i = bePriceS
while i <= bePriceF:
bePrice.append(i)
i+=step
T = []
for s in bePrice:
T.append(self.thetaFull(s, params, exp))
plt.plot(bePrice, T, label=int(exp*god))
def plotVega(self, bePriceS, bePriceF, params, exp, step):
bePrice = []
i = bePriceS
while i <= bePriceF:
bePrice.append(i)
i+=step
V = []
for s in bePrice:
V.append(self.vegaFull(s, params, exp))
plt.plot(bePrice, V, label=int(exp*god))
def plotGamma(self, bePriceS, bePriceF, params, exp, step):
bePrice = []
i = bePriceS
while i <= bePriceF:
bePrice.append(i)
i+=step
V = []
for s in bePrice:
V.append(self.gammaFull(s, params, exp))
plt.plot(bePrice, V, label=int(exp*god))