aboutsummaryrefslogtreecommitdiffstats
path: root/python/exploration/jtd.py
blob: 10fd842231f4ce2136bee11f25959029fa39cadc (plain)
1
2
3
4
5
6
7
8
9
10
11
from risk.indices import get_index_portfolio
from serenitas.utils.db import dbconn
import datetime

month_end = datetime.date(2021, 8, 31)
conn = dbconn("dawndb")
portf = get_index_portfolio(month_end, conn, by_strat=False)
d = {}
for t in portf:
    d[(t.name, t.notional)] = t.jtd_single_names().reset_index(1, drop=True)
result = pd.concat(d, axis=1, names=["name", "notional"]).sort_index()