aboutsummaryrefslogtreecommitdiffstats
path: root/python/globeop_reports.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/globeop_reports.py')
-rw-r--r--python/globeop_reports.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/python/globeop_reports.py b/python/globeop_reports.py
index bb2c01db..f624971c 100644
--- a/python/globeop_reports.py
+++ b/python/globeop_reports.py
@@ -139,7 +139,7 @@ def pnl_alloc_plot(df):
ax.set_yticklabels(['{:.2f}%'.format(y*100) for y in y_ticks])
plt.tight_layout()
-def cap_alloc_plot(df):
+def cap_alloc_plot_pie(df):
""" Takes the alloc('capital') dataframe"""
# create piechart and add a circle at the center
@@ -158,7 +158,7 @@ def avg_turnover():
last_monthend = datetime.date.today() - off.MonthEnd(1)
sql_string = "SELECT * FROM bonds where buysell = 'False'"
df = pd.read_sql_query(sql_string, dbengine('dawndb'),
- parse_dates=['lastupdate', 'trade_date', 'settle_date'])
+ parse_dates={'lastupdate':'utc=True', 'trade_date':'', 'settle_date':''})
df = df[(df.trade_date > last_monthend - off.MonthEnd(12))
& (df.trade_date <= last_monthend)]
return (df.principal_payment + df.accrued_payment).sum()/avg_nav
@@ -184,7 +184,7 @@ def shift_cash(date, amount, df, strat):
df.loc[date,'Cash'] = df.loc[date, 'Cash'] + amount/nav.loc[date].endbooknav
return df
-def cap_alloc_plot(df):
+def cap_alloc_plot_bar(df):
#ax = df.plot.bar(stacked=True)
ax = df[:-1].plot.bar(stacked=True, legend=False, figsize=(10,4))
@@ -201,7 +201,6 @@ def cap_alloc_plot(df):
ax.xaxis.set_label_text("")
return ax
- #plt.tight_layout()
def calc_trade_performance_stats():
df = trade_performance().set_index('trade_date')