def BSM_theta(St, K, t, T, r, sigma): ''' Black-Scholes-Merton THETA of European call option. Parameters ========== St : float stock/index level at time t K : float strike price t : float valuation date T : float date of maturity/time-to-maturity if t = 0; T > t r : float constant, risk-less short rate sigma : float volatility Returns ======= theta : float European call option THETA ''' d1 = d1f(St, K, t, T, r, sigma) d2 = d1 - sigma * math.sqrt(T - t) theta = -(St * dN(d1) * sigma / (2 * math.sqrt(T - t)) + r * K * math.exp(-r * (T - t)) * N(d2)) return theta
def BSM_delta(St, K, t, T, r, sigma): ''' Black-Scholes-Merton DELTA of European call option. Parameters ========== St : float stock/index level at time t K : float strike price t : float valuation date T : float date of maturity/time-to-maturity if t = 0; T > t r : float constant, risk-less short rate sigma : float volatility Returns ======= delta : float European call option DELTA ''' d1 = d1f(St, K, t, T, r, sigma) delta = N(d1) return delta
def BSM_rho(St, K, t, T, r, sigma): ''' Black-Scholes-Merton RHO of European call option. Parameters ========== St : float stock/index level at time t K : float strike price t : float valuation date T : float date of maturity/time-to-maturity if t = 0; T > t r : float constant, risk-less short rate sigma : float volatility Returns ======= rho : float European call option RHO ''' d1 = d1f(St, K, t, T, r, sigma) d2 = d1 - sigma * math.sqrt(T - t) rho = K * (T - t) * math.exp(-r * (T - t)) * N(d2) return rho
def BSM_delta(St, K, t, T, r, sigma): d1 = dlf(St, K, t, T, r, sigma) delta = N(d1) return delta
def BSM_rho(St, K, t, T, r, sigma): d1 = dlf(St, K, t, T, r, sigma) d2 = d1 - sigma * math.sqrt(T - t) rho = K * (T - t) * math.exp(-r * (T - t)) * N(d2) return rho
def BSM_theta(St, K, t, T, r, sigma): d1= dlf(St, K, t, T, r, sigma) d2 = d1 - sigma * math.sqrt(T - t) theta = -(St * dN(d1) * sigma / (2 * math.sqrt(T-t)) + r * K * math.exp(-r * (T - t) * N(d2))) return theta