aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--R/build_portfolios.R5
-rw-r--r--python/cusip_universe.py2
2 files changed, 5 insertions, 2 deletions
diff --git a/R/build_portfolios.R b/R/build_portfolios.R
index ef32bf1e..31c34000 100644
--- a/R/build_portfolios.R
+++ b/R/build_portfolios.R
@@ -68,9 +68,12 @@ cusipdata <- cusip.data()
currdealnames <- dbGetQuery(dbCon, "select updatedate, dealname from latest_deal_model_numbers")
## build portfolio data
for(deal.name in dealnames){
+ if(is.na(deal.name)){
+ next
+ }
deal.data <- getdealdata(deal.name, calibration.date)
if(deal.data$"Curr Collat Bal" < 1 ||is.na(deal.data$maturity)||deal.data$maturity <= today()+90){
- return()
+ next
}
deal.portfolio <- buildSC.portfolio(deal.name, deal.data, cusipdata, global.params, workdate)
A <- SPmatrix2(deal.portfolio$SC, deal.data, freq="3 months")
diff --git a/python/cusip_universe.py b/python/cusip_universe.py
index 471b0aae..db9a8ac8 100644
--- a/python/cusip_universe.py
+++ b/python/cusip_universe.py
@@ -45,7 +45,7 @@ def upload_data(workdate, conn, cursor):
cursor.execute(sqlstring, (line['CUSIP'],))
curr_date = cursor.fetchone()
if not curr_date or curr_date[0] < dealupdate[dealname]:
- if dealname in deals_to_update:
+ if dealname not in deals_to_update:
deals_to_update.append(dealname)
line['updatedate'] = dealupdate[dealname]
for key in ['Curr Balance', 'Orig Balance', 'Orig Attachment Point',