diff options
| -rw-r--r-- | R/mlpdb.R | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -81,9 +81,15 @@ get.tranchequotes <- function(indexname, tenor='5yr', date=Sys.Date()){ flag <- FALSE ##we loop through the disctinct quotes until we find a complete set for(i in 1:nrow(distinct.quotes)){ - sqlstr <- paste("select * from tranche_quotes where index='%s'", - "and series=%s and tenor = '%s' and quotedate='%s'", - "and detach not in(5,10) and quotesource='%s' order by attach asc") + if(temp$index == 'HY'){ ##don't want the tranchelets quoted by CITI + sqlstr <- paste("select * from tranche_quotes where index='%s'", + "and series=%s and tenor = '%s' and quotedate='%s'", + "and detach not in(5,10) and quotesource='%s' order by attach asc") + }else{ + sqlstr <- paste("select * from tranche_quotes where index='%s'", + "and series=%s and tenor = '%s' and quotedate='%s'", + "and quotesource='%s' order by attach asc") + } r <- dbGetQuery(mlpdbCon, sprintf(sqlstr, temp$index, temp$series, tenor, distinct.quotes$quotedate[i], distinct.quotes$quotesource[i])) |
