aboutsummaryrefslogtreecommitdiffstats
path: root/R/mlpdb.R
diff options
context:
space:
mode:
Diffstat (limited to 'R/mlpdb.R')
-rw-r--r--R/mlpdb.R5
1 files changed, 2 insertions, 3 deletions
diff --git a/R/mlpdb.R b/R/mlpdb.R
index 7136a153..5778774e 100644
--- a/R/mlpdb.R
+++ b/R/mlpdb.R
@@ -71,7 +71,6 @@ get.tranchequotes <- function(indexname, tenor='5yr', date=Sys.Date()){
if(length(unique(r$attach))==length(r$attach) && all(c(r$attach, 100)==c(lower.attach, r$detach))){
return(r)
}
-
##else we work harder
##we get the list of distinct quotes
sqlstr <- paste("select distinct quotesource, quotedate from tranche_quotes",
@@ -81,10 +80,10 @@ 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)){
- if(temp$index == 'HY'){ ##don't want the tranchelets quoted by CITI
+ if(temp$index == 'HY' && temp$series>=15){ ##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")
+ "and detach-attach!=5 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'",