diff options
| -rw-r--r-- | R/new_index_series.R | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/R/new_index_series.R b/R/new_index_series.R index b5161dc0..fe234afc 100644 --- a/R/new_index_series.R +++ b/R/new_index_series.R @@ -50,10 +50,9 @@ newcurves <- function(indextype, series, basketid){ ticker=cds_corp_tkr, currency=index[,3], seniority=sw_seniority, doc_clause=cds_restructuring_type, curve_ticker=tickers)) - all.companyids <- dbGetQuery(serenitasdb, "SELECT company_id FROM bbg_issuers") prep.data <- prep.data[!prep.data$company_id %in% all.companyids$company_id,] - if(nrow(prep.data)>0){ + if(nrow(prep.data) > 0){ cdscurves <- data.frame() for(ticker in prep.data$curve_ticker){ cdscurves <- rbind(cdscurves, @@ -104,11 +103,11 @@ markit.mappings <- function(df){ } if(interactive()) { - bbgid <- newbasketID('IG', 26, 1, as.Date("20121-06-20"), 100) - df <- newcurves('IG', 26, bbgid) + basket.id <- newbasketID('HY', 26, 1, as.Date("2021-06-20"), 500) + df <- newcurves('HY', 26, basket.id) mappings <- data.frame(company_id = df$company_id, - markit_ticket=c("HESS","GE", "JNJ", "LNC", "WESTMWV", "PACKAM"), - seniority="SNRFOR", coupon=100) - markit.mappings(df) + markit_ticker=c("BLL","THEADT", "EQIX", "TRADIG", "TGRI-Ptnr", "ETE"), + seniority=c(rep("SNRFOR",3),"SUBLT2","SNRFOR","SECDOM"), coupon=500) + markit.mappings(mappings) ## then update index_list in markit/import_quotes.py and rerun insert_cds } |
