Price European options on dividend-paying stocks using Merton (Me)
masterUse the mibian.Me class to price European options on stocks that pay dividends.
Constructor Arguments:
Pass a list containing [underlyingPrice, strikePrice, interestRate, annualDividends, daysToExpiration] followed by optional keyword arguments:
volatility: The asset volatility.callPrice: The current market price of the call option.putPrice: The current market price of the put option.
Available Attributes/Methods:
callPrice,putPrice: Option prices.callDelta,putDelta: Option deltas.callDelta2,putDelta2: Dual deltas.callTheta,putTheta: Option theta.callRho,putRho: Option rho.vega: Option vega.gamma: Option gamma.impliedVolatility: Returns the implied volatility ifcallPriceorputPriceis provided.putCallParity: Returns the put-call parity if bothcallPriceandputPriceare provided.
import mibian
# Pricing with volatility
c = mibian.Me([52, 50, 1, 1, 30], volatility=20)
print(c.callPrice)
print(c.callDelta)
# Calculating implied volatility
c = mibian.Me([52, 50, 1, 1, 30], callPrice=0.0359)
print(c.impliedVolatility)