option2 = Option(t=0.5*252, S0=42, K=40, OptionType='P', r=0.1, vol=0.2)
option2.get_option_price()
option2.get_option_greeks()
----------Calculate the option price----------
The Black-Scholes-Merton option price is: 0.81
The Monte-Carlo simulation option price is: 0.81
----------Calculate the option greeks----------
Delta: -0.2209
Gamma: 0.0500
Theta: -0.0030
Vega: 8.8135
Rho: -5.0424
option3 = Option(t=0.5*252, S0=42, K=40, OptionType='C', r=0.1, price=4.759)
option3.get_option_implied_vol()
----------Calculate the option implied vol----------
----------Newton-Raphson method:
Iteration: 6
Accuracy: -6.59e-12
The implied volatility is: 20.00%
----------Bisection method:
Iteration: 25
Accuracy: 4.54e-08
The implied volatility is: 20.00%
Options Greeks calculation with Python:
http://www.quantacademy.com/2014/09/options-greeks-calculation-with-python/
《Options, Futures, and Other Derivatives (10th edition)》by John C. Hull
更多精彩内容请访问我的博客,一起来康康吧!Options Calculator这是一个全能的期权计算器,涵盖 BS法,蒙特卡洛法,二叉数法,能够对看涨期权,看跌期权,欧式期权,美式期权,有股利期权,无股利期权进行定价,并附带GUI客户端。本计算器的特色在于支持非常全面的期权类型美观优雅简洁大方的界面采用了多线程的方式来优化用户体验可以直接提取使用其中的 Option 类来应用于你所需要的计算期权价...
Options Calculator这是一个全能的期权计算器,涵盖 BS法,蒙特卡洛法,二叉数法,能够对看涨期权,看跌期权,欧式期权,美式期权,有股利期权,无股利期权进行定价,并附带GUI客户端。本计算器的特色在于支持非常全面的期权类型美观优雅简洁大方的界面可以直接提取使用其中的 Option 类来应用于你所需要的计算期权价格的地方。可以指定具体日期而不用再手动算时间间隔可以直接输入一年计无风险利...
1 编写一个期权类“万物皆对象”,既然我们需要针对一个欧式期权进行计算,不妨将期权编写成一个类,在将某个期权实例化为对象时,将其各种属性赋予这个对象。编写类时,要先给类起一个名字,比如Option.然后想象一下,一个欧式期权应该具有哪些属性,从而编写一个初始化函数。我们的欧式期权,应该具有以下几个属性。看涨或看跌(c or p)标的资产现价(S0)期权执行价格(K)期权到期时间(t)适用的无风险利...