Options Trading, Call, Put, Monte Carlo, Tejapi Quant.
in range(0,Nsteps): epsilon = np.random.normal() SPATH1[i,j+1] = SPATH1[i,j] * np.exp(nudt + sidt * epsilon) SPATH2[i,j+1] = SPATH2[i,j] * np.exp(nudt - sidt * epsilon) if CallOrPut == 'call': C1 = np.maximum(SPATH1[:, -1] - K, 0) C2 = np.maximum(SPATH2[:, -1] - K, 0) C = np.mean(0.5 * (C1 + C2))