aboutsummaryrefslogtreecommitdiffstats
path: root/python/quote_diff_bowdst.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/quote_diff_bowdst.py')
-rw-r--r--python/quote_diff_bowdst.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/python/quote_diff_bowdst.py b/python/quote_diff_bowdst.py
new file mode 100644
index 00000000..dcd861fd
--- /dev/null
+++ b/python/quote_diff_bowdst.py
@@ -0,0 +1,29 @@
+from serenitas.utils.db import dbconn
+import numpy as np
+import datetime
+import pandas as pd
+
+conn = dbconn("dawndb")
+
+with conn.cursor() as c:
+ days = pd.bdate_range(end=datetime.date.today(), periods=60)
+ for date in days:
+ df = pd.read_sql(
+ sql="SELECT * FROM list_bowd_quotes(%s)",
+ con=conn,
+ params=(date.date(),),
+ )
+ try:
+ print(df[~np.isclose(df["bowd_price"], df["closeprice"], atol=0.15)])
+ except TypeError:
+ pass
+ # c.execute("select security_desc, tenor, price, closeprice from list_cds_marks(%s, null, 'BOWDST') a left join index_quotes using (index, series, version, tenor) where date = %s",
+ # (date.date(), date.date(),))
+
+ # for row in c:
+ # print(date)
+ # print(row.price, row.closeprice)
+ # if row.price != row.closeprice:
+ # breakpoint()
+ # if not np.isclose(row.price, row.closeprice, atol=.01):
+ # print(row.security_desc, row.tenor, row.price, row.closeprice)