diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/intex_prices.py | 6 | ||||
| -rw-r--r-- | python/intex_scenarios.py | 10 |
2 files changed, 9 insertions, 7 deletions
diff --git a/python/intex_prices.py b/python/intex_prices.py index 4ac14810..9b36ffb7 100644 --- a/python/intex_prices.py +++ b/python/intex_prices.py @@ -33,12 +33,12 @@ def sanitize_float(string): fields = ["Price", "WAL", "Market Value", "Modified Duration"]
dealdata = {}
-
+workdate = '2013-01-09'
for dealname in ["abcl071", "ammcclo5"]:
- tranches = os.listdir(os.path.join(root, "Scenarios", "Prices", dealname))
+ tranches = os.listdir(os.path.join(root, "Scenarios", "Prices_" + workdate, dealname))
d = {}
for tranche in tranches:
- data = pd.read_table(os.path.join(root, "Scenarios", "Prices", dealname, tranche))
+ data = pd.read_table(os.path.join(root, "Scenarios", "Prices_" + workdate, dealname, tranche))
datamod = data[data.columns[2:-1]].T
datamod.columns = data[data.columns[1]]
for field in fields:
diff --git a/python/intex_scenarios.py b/python/intex_scenarios.py index 49fb7067..b059fe0c 100644 --- a/python/intex_scenarios.py +++ b/python/intex_scenarios.py @@ -39,7 +39,7 @@ conn = psycopg2.connect(database="ET", host="192.168.1.108")
cursor = conn.cursor()
-workdate = date.today().strftime('%Y-%m-%d')
+# workdate = date.today().strftime('%Y-%m-%d')
collatdate = '2013-01-04'
def get_reinv_assets(dealname, date):
@@ -55,7 +55,8 @@ def get_reinv_assets(dealname, date): d['REINV_TBA2'] = line['Fixed or Float']
return d
-for dealname in ["abcl071", "ammcclo5", "atr4cdo", "atr5cdo", "blumt3", "callid6", "goldl5", "limes", "oceant2", "symph4"]:
+# for dealname in ["abcl071", "ammcclo5", "atr4cdo", "atr5cdo", "blumt3", "callid6", "goldl5", "limes", "oceant2", "symph4"]:
+for dealname in ["abcl071"]:
cursor.execute('SELECT \"Reinv End Date\" from latest_clo_universe where dealname=%s', (dealname,))
reinvenddate = cursor.fetchone()[0]
if reinvenddate:
@@ -90,10 +91,11 @@ for dealname in ["abcl071", "ammcclo5", "atr4cdo", "atr5cdo", "blumt3", "callid6 if "DEAL_NAME" in line:
newline = "DEAL_NAME=" + dealname.upper()
fh2.write(newline)
+ continue
if pattern11.match(line):
line = re.sub(pattern11, r"\1{0}\2", line).format(dealname.upper()).rstrip()
if reinv_assets["REINV_TBA1"] == "Float":
- line = line + "COUP_SPR=2.5|AMORT=Bullet|USE_REINVEST_PIP=1|MAT_DATE=84|\n"
+ line = line + "COUP_SPR=3.45|AMORT=Bullet|USE_REINVEST_PIP=1|MAT_DATE=84|\n"
elif reinv_assets["REINV_TBA1"] == "Fixed":
line = line + "COUP_SPR=7|AMORT=Bullet|USE_REINVEST_PIP=1|MAT_DATE=84|\n"
fh2.write(line)
@@ -101,7 +103,7 @@ for dealname in ["abcl071", "ammcclo5", "atr4cdo", "atr5cdo", "blumt3", "callid6 if pattern12.match(line):
line = re.sub(pattern12, r"\1{0}\2", line).format(dealname.upper()).rstrip()
if reinv_assets["REINV_TBA2"] == "Float":
- line = line + "COUP_SPR=2.5|AMORT=Bullet|USE_REINVEST_PIP=1|MAT_DATE=84|\n"
+ line = line + "COUP_SPR=3.45|AMORT=Bullet|USE_REINVEST_PIP=1|MAT_DATE=84|\n"
elif reinv_assets["REINV_TBA2"] == "Fixed":
line = line + "COUP_SPR=7|AMORT=Bullet|USE_REINVEST_PIP=1|MAT_DATE=84|\n"
fh2.write(line)
|
