search for: marketdata

Displaying 6 results from an estimated 6 matches for "marketdata".

2011 Aug 16
2
Calibrating the risk free interest rate using nlminb
...tilities minus the market price of a call (assuming this is just the average bid ask price) Here is my data: http://r.789695.n4.nabble.com/file/n3747509/S%26P_500_calls%2C_jan-jun_2010.csv 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)...
2011 Aug 18
3
Error message: object of type 'closure' is not subsettable
...object of type 'closure' is not subsettable And I don't know what this mean and what I am doing wrong. Can anyone help me? Here is my code and data set. Best Rikke http://r.789695.n4.nabble.com/file/n3752886/S%26P_500_calls%2C_jan-jun_2010.csv S%26P_500_calls%2C_jan-jun_2010.csv marketdata <- read.csv(file="S&P 500 calls, jan-jun 2010.csv", header=TRUE, sep=";") spot <- read.csv(file="S&P 500 spot and return 2010.csv", header=TRUE, sep=";") #------------------------- Values ---------------------------------- #### Data imported S0...
2011 Aug 25
2
Adding a normal density curve over the empirical curve
...on of the two. Does anyone know how to do this? (NB the last two lines are the problem, and are wrong, I know). Thank you in advance! Rikke http://r.789695.n4.nabble.com/file/n3768783/S%26P_500_spot_and_return_2010.csv S%26P_500_spot_and_return_2010.csv setwd("F:/Data til speciale/") marketdata <- read.csv(file="S&P 500 spot and return 2010.csv", header=TRUE, sep=";") returns <- marketdata[,7] ### Kernel density estimator ########################### x <- density (returns) plot(density(returns), main = "Kernel density") y <- rnorm(209,mean...
2011 Nov 15
0
Quantstrat; error with applyStrategy()
...;, pos=.strategy) ) ################################################## # Get Data # ################################################## ch <- odbcConnect("PostgreSQL35W") tablenames <- sqlTables(ch, schema = "marketdata")[,"TABLE_NAME"] chooseTable <- function(table.name) x <- table.name table.name <- guiv(chooseTable, argList = list(table.name = tablenames)) data.df <- sqlFetch(ch, paste("marketdata", table.na...
2008 Dec 22
2
How can I avoid nested 'for' loops or quicken the process?
Hi All, I'm still pretty new to using R - and I was hoping I might be able to get some advice as to how to use 'apply' or a similar function instead of using nested for loops. Right now I have a script which uses nested for loops similar to this: i <- 1 for(a in Alpha) { for (b in Beta) { for (c in Gamma) { for (d in Delta) { for (e in Epsilon) { Output[i] <-
2012 Jan 18
1
Problems with Panel Data estimation
Hi everybody, Got some doubts here. I'm kinda desperate for help, so please ask me if anything isn't clear. I have a database with this structure (panel data structure): > head(dados_2) Tempo Safra Data Resposta Perc_Resg_Acum Alta_Temporada Flexi Promo 1 1 1 200701 0.04223216 0 1 0 0 2 1 2 200702 0.02801536 0