aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/cds_rebook.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/cds_rebook.py b/python/cds_rebook.py
index fa72bf5a..6a50c90d 100644
--- a/python/cds_rebook.py
+++ b/python/cds_rebook.py
@@ -3,7 +3,7 @@ import datetime
import pandas as pd
from pandas.tseries.offsets import BDay
from psycopg2.extras import execute_values
-from pyisda.date import default_accrual, previous_twentieth
+from pyisda.date import cds_accrued, default_accrual, previous_twentieth
from analytics.index import CreditIndex
from copy import copy
@@ -25,8 +25,8 @@ def get_outstanding_positions(conn, trade_date, fcm, fund="SERCGMAST"):
def indices_to_remark(conn, auction_date: datetime.date, fee, accrual_days):
- adj_recovery = 1 - fee + (accrual_days - cds_accrued(auction_date)) * 0.05 / 360
- breakpoint()
+ adj_recovery = 100 * (1 - fee + accrual_days * 0.05/360 -
+ cds_accrued(auction_date, 0.05))
with conn.cursor() as c1, conn.cursor() as c2:
c1.execute(
"SELECT index, series, old.version, old.indexfactor AS oldfactor, "
@@ -40,7 +40,7 @@ def indices_to_remark(conn, auction_date: datetime.date, fee, accrual_days):
"INSERT into index_quotes_pre(date, index, series, version, "
"tenor, close_price, source)"
"SELECT date, index, series, version+1, "
- "tenor, (%s*close_price - %s)/%s, 'MKIT'"
+ "tenor, (%s*close_price + %s)/%s, 'MKIT'"
"FROM index_quotes_pre "
"WHERE index=%s AND series=%s AND version=%s AND date=%s AND source='MKIT'",
(