@@ -1520,7 +1520,7 @@ def plot_capacity_sweep(returns, transactions, market_data,
1520
1520
return ax
1521
1521
1522
1522
1523
- def plot_daily_turnover_hist (transactions , positions ,
1523
+ def plot_daily_turnover_hist (transactions , positions , turnover_denom = 'AGB' ,
1524
1524
ax = None , ** kwargs ):
1525
1525
"""
1526
1526
Plots a histogram of daily turnover rates.
@@ -1533,6 +1533,9 @@ def plot_daily_turnover_hist(transactions, positions,
1533
1533
positions : pd.DataFrame
1534
1534
Daily net position values.
1535
1535
- See full explanation in tears.create_full_tear_sheet.
1536
+ turnover_denom : str, optional
1537
+ Either AGB or portfolio_value, default AGB.
1538
+ - See full explanation in txn.get_turnover.
1536
1539
ax : matplotlib.Axes, optional
1537
1540
Axes upon which to plot.
1538
1541
**kwargs, optional
@@ -1546,7 +1549,7 @@ def plot_daily_turnover_hist(transactions, positions,
1546
1549
1547
1550
if ax is None :
1548
1551
ax = plt .gca ()
1549
- turnover = txn .get_turnover (positions , transactions )
1552
+ turnover = txn .get_turnover (positions , transactions , turnover_denom )
1550
1553
sns .distplot (turnover , ax = ax , ** kwargs )
1551
1554
ax .set_title ('Distribution of daily turnover rates' )
1552
1555
ax .set_xlabel ('Turnover rate' )
0 commit comments