Displaying 1 result from an estimated 1 matches for "mid_bidask".
2011 Aug 16
2
Calibrating the risk free interest rate using nlminb
...S%26P_500_calls%2C_jan-jun_2010.csv
S0 <- 1136.03
q <- 0.02145608
S0 <- spot[10,6]
S0
strike <- marketdata[1:460,9]
T <- marketdata[1:460,17]/365 #Notice the T is measured in years now
implvol <- marketdata[1:460,12]
ask <- marketdata[1:460,10]
bid <- marketdata[1:460,11]
mid_bidask <- (bid + ask) /2
r <- 0.020
And my code:
BS_Call <- function(S0, K, T, r, sigma, q) # Which works
fine
{
sig <- sigma * sqrt(T)
d1 <- (log (S0/K) + (r - q + sigma^2/2) * T ) / sig
d2 <- d1 - sig
Presentvalue <- exp(-r*T)
return (S0 * exp(-q*T) * pnorm(d1...