@@ -1323,7 +1323,7 @@ def plot_return_quantiles(returns, live_start_date=None, ax=None, **kwargs):
13231323 return ax
13241324
13251325
1326- def plot_turnover (returns , transactions , positions ,
1326+ def plot_turnover (returns , transactions , positions , turnover_denom = 'AGB' ,
13271327 legend_loc = 'best' , ax = None , ** kwargs ):
13281328 """
13291329 Plots turnover vs. date.
@@ -1345,6 +1345,9 @@ def plot_turnover(returns, transactions, positions,
13451345 positions : pd.DataFrame
13461346 Daily net position values.
13471347 - See full explanation in tears.create_full_tear_sheet.
1348+ turnover_denom : str, optional
1349+ Either AGB or portfolio_value, default AGB.
1350+ - See full explanation in txn.get_turnover.
13481351 legend_loc : matplotlib.loc, optional
13491352 The location of the legend on the plot.
13501353 ax : matplotlib.Axes, optional
@@ -1364,7 +1367,7 @@ def plot_turnover(returns, transactions, positions,
13641367 y_axis_formatter = FuncFormatter (utils .two_dec_places )
13651368 ax .yaxis .set_major_formatter (FuncFormatter (y_axis_formatter ))
13661369
1367- df_turnover = txn .get_turnover (positions , transactions )
1370+ df_turnover = txn .get_turnover (positions , transactions , turnover_denom )
13681371 df_turnover_by_month = df_turnover .resample ("M" ).mean ()
13691372 df_turnover .plot (color = 'steelblue' , alpha = 1.0 , lw = 0.5 , ax = ax , ** kwargs )
13701373 df_turnover_by_month .plot (
0 commit comments