title: Arithmetic Asian Option Pricing
body: <p>I keep getting the invalid procedure call or argument error on the definition of sigma2d line. 
  Any idea how to avoid this code error?    </p>
  
  <pre><code>Private Sub CommandButton4_Click()
  Application.Range("E19").value = ""
  
  Application.Range("F19").value = ""
  S0 = Application.Range("C5").value 'arithmetic average of underlying 1
  K = Application.Range("C6").value 'strike
  T = Application.Range("C10").value 'maturity
  sigma = Application.Range("C8").value 'volatility
  r = Application.Range("C8").value 'risk free rate
  nsteps = Application.Range("C12").value 'no of timesteps
  nsimulations = Application.Range("C13").value ' no of mc simulations
  div = Application.Range("C9").value          'dividends
  Randomize
  
  Dim M1 As Double, M2 As Double, sigma2d As Double
  Dim d1 As Double, d2 As Double, Nd1 As Double, Nd2 As Double
  
  M1 = (Exp((r - div) * T) - 1) / (r - div) * T
  
  v = (2 * Exp((2 * r) - (2 * div) + (sigma * sigma) * T)) * S0 * S0
  w = (r - div + (sigma * sigma)) * (2 * r - 2 * q + (sigma * sigma)) * T * T
  Z = 2 * S0 * S0 / ((r - div) * T * T)
  
  y = (1 / 2 * (r - div) + sigma * sigma)
  h = Exp((r - div) * T) / (r - div + (sigma * sigma))
  
  M2 = (v / w) + Z * (y - h)
  M3 = M1 * M1
  
  sigma2d = Log(M2 / M3)
  d1 = (Log(M1 / K) + (sigma2d * T) / 2) / sigma * Sqr(T)
  d2 = d1 - sigma * Sqr(T)
  
  callArith = Exp(-r * T) * (M1 * Nd1 - K * Nd2)
  Application.Range("E19").value = Application.Max(ExactCall, 0)
  </code></pre>