search for: fromdt

Displaying 1 result from an estimated 1 matches for "fromdt".

Did you mean: fromat
2011 Jan 12
1
snowfall
...TRUE) #Trying to calculate the trading days require(fractalrock,quietly=TRUE) #Just to calculate the trading days myFinCenter="Asia/Singapore" getTimeToMaturity <- function(x){ tryCatch({ toDt <- as.Date(as.character(x['EXPIRY_DT']), "%Y-%m-%d") #Expiry Date fromDt <- as.Date(as.character(x['TIMESTAMP']), "%Y-%m-%d") #Trade Timestamp NoOfDays <- NROW(getTradingDates(toDt,fromDt)) return(NoOfDays/252) }, error = function (ex){ #print (paste("Error in",toDt,fromDt)) NoOfDays <- 0 return(NoOfDays/252) } ) } Qu...