-
Notifications
You must be signed in to change notification settings - Fork 79
/
README
109 lines (84 loc) · 4.41 KB
/
README
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
MibianLib - Options Pricing Open Source Library - http://code.mibian.net/
Copyright (C) 2011 Yassine Maaroufi - <[email protected]>
Distributed under GPLv3 - http://www.gnu.org/copyleft/gpl.html
Documentation
-------------
BS - Black-Scholes Used for pricing European options on stocks without dividends
BS([underlyingPrice, strikePrice, interestRate, daysToExpiration], volatility=x, callPrice=y, putPrice=z)
eg:
c = mibian.BS([1.4565, 1.45, 1, 30], volatility=20)
c.callPrice Returns the call price
c.putPrice Returns the put price
c.callDelta Returns the call delta
c.putDelta Returns the put delta
c.callDelta2 Returns the call dual delta
c.putDelta2 Returns the put dual delta
c.callTheta Returns the call theta
c.putTheta Returns the put theta
c.callRho Returns the call rho
c.putRho Returns the put rho
c.vega Returns the option vega
c.gamma Returns the option gamma
c = mibian.BS([1.4565, 1.45, 1, 30], callPrice=0.0359)
c.impliedVolatility Returns the implied volatility from the call price
c = mibian.BS([1.4565, 1.45, 1, 30], putPrice=0.0306)
c.impliedVolatility Returns the implied volatility from the put price
c = mibian.BS([1.4565, 1.45, 1, 30], callPrice=0.0359, putPrice=0.0306)
c.putCallParity Returns the put-call parity
GK - Garman-Kohlhagen Used for pricing European options on currencies
GK([underlyingPrice, strikePrice, domesticRate, foreignRate, daysToExpiration], volatility=x, callPrice=y, putPrice=z)
eg:
c = mibian.GK([1.4565, 1.45, 1, 2, 30], volatility=20)
c.callPrice Returns the call price
c.putPrice Returns the put price
c.callDelta Returns the call delta
c.putDelta Returns the put delta
c.callDelta2 Returns the call dual delta
c.putDelta2 Returns the put dual delta
c.callTheta Returns the call theta
c.putTheta Returns the put theta
c.callRhoD Returns the call domestic rho
c.putRhoD Returns the put domestic rho
c.callRhoF Returns the call foreign rho
c.putRhoF Returns the call foreign rho
c.vega Returns the option vega
c.gamma Returns the option gamma
c = mibian.GK([1.4565, 1.45, 1, 2, 30], callPrice=0.0359)
c.impliedVolatility Returns the implied volatility from the call price
c = mibian.GK([1.4565, 1.45, 1, 2, 30], putPrice=0.03)
c.impliedVolatility Returns the implied volatility from the put price
c = mibian.GK([1.4565, 1.45, 1, 2, 30], callPrice=0.0359, putPrice=0.03)
c.putCallParity Returns the put-call parity
Me - Merton Used for pricing European options on stocks with dividends
Me([underlyingPrice, strikePrice, interestRate, annualDividends, daysToExpiration], volatility=x, callPrice=y, putPrice=z)
eg:
c = mibian.Me([52, 50, 1, 1, 30], volatility=20)
c.callPrice Returns the call price
c.putPrice Returns the put price
c.callDelta Returns the call delta
c.putDelta Returns the put delta
c.callDelta2 Returns the call dual delta
c.putDelta2 Returns the put dual delta
c.callTheta Returns the call theta
c.putTheta Returns the put theta
c.callRho Returns the call rho
c.putRho Returns the put rho
c.vega Returns the option vega
c.gamma Returns the option gamma
c = mibian.Me([52, 50, 1, 1, 30], callPrice=0.0359)
c.impliedVolatility Returns the implied volatility from the call price
c = mibian.Me([52, 50, 1, 1, 30], putPrice=0.0306)
c.impliedVolatility Returns the implied volatility from the put price
c = mibian.Me([52, 50, 1, 1, 30], callPrice=0.0359, putPrice=0.0306)
c.putCallParity Returns the put-call parity
Contributions:
--------------
Contributions to MibianLib are welcome. Please send suggestions, critics,
patches to [email protected]. Otherwise you can create a fork on
github at https://github.com/yassinemaaroufi/MibianLib.
Contributors List:
------------------
Yassine Maaroufi <[email protected]>
Jack Grahl <[email protected]>
Dmitry Vatolin <[email protected]>
https://github.com/smickles