Given the following code (S0 = Initial Share Price, r= (risk-free) interest rate, K=Strike, Sigma= Standard Deviation, T=years, nExp=Number of Experiments)
def MonteCarlo_OptionPricing(S0, K, r, sigma, T, nExp=100000):
rMC = rd.randn(n_exp) * sigma * np.sqrt(T) + (r - sigma**2 / 2) * T
ST = S0 * np.exp(rMC)
cT = np.maximum(ST-K, 0)
c0 = np.mean(cT) * np.exp(-r*T)
return c0
For large nExp it will basically return almost the same value for European options as the (standard) Black-Scholes-Model.
My question concerns (r - sigma**2 / 2) * T
: What exactly is this part accounting for? Is that taking care of the drift?
Any input is welcome!