Hi,
I'm trying to learn Python and is only my second day learning the code. At the moment, I'm trying to use the Mibian library to do some simple options pricing.
I've written this simple code to do some calculations:
The results from the above are as below:
I feel like I'm made some newbie error somewhere. Appreciate any feedback. Thanks.
I'm trying to learn Python and is only my second day learning the code. At the moment, I'm trying to use the Mibian library to do some simple options pricing.
I've written this simple code to do some calculations:
1 2 3 4 5 6 7 8 9 |
import mibian def BSModel(): c = mibian.BS([ 40.75 , 32 , 1 , 127 , 30 ], putPrice = 0.95 ) print ( "Implied vol is " ,c.impliedVolatility) print ( "Delta is " ,c.putDelta) print ( "Theta is " ,c.putTheta) print ( "Vega is " ,c.vega) print ( "Gamma is " ,c.gamma) |
Output:BSModel()
Implied vol is 45.654296875
Delta is None
Theta is None
Vega is None
Gamma is None
Strangely, it's only showing the calculation for the implied volatility but the rest is returning none. I've tried changing the input data but it's doing the same. I feel like I'm made some newbie error somewhere. Appreciate any feedback. Thanks.