@plotting.customize<EOL>def create_capacity_tear_sheet(returns, positions, transactions,<EOL>market_data,<EOL>liquidation_daily_vol_limit=<NUM_LIT>,<EOL>trade_daily_vol_limit=<NUM_LIT>,<EOL>last_n_days=utils.APPROX_BDAYS_PER_MONTH * <NUM_LIT:6>,<EOL>days_to_liquidate_limit=<NUM_LIT:1>,<EOL>estimate_intraday='<STR_LIT>'):
positions = utils.check_intraday(estimate_intraday, returns,<EOL>positions, transactions)<EOL>print("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL>max_days_by_ticker = capacity.get_max_days_to_liquidate_by_ticker(<EOL>positions, market_data,<EOL>max_bar_consumption=liquidation_daily_vol_limit,<EOL>capital_base=<NUM_LIT>,<EOL>mean_volume_window=<NUM_LIT:5>)<EOL>max_days_by_ticker.index = (<EOL>max_days_by_ticker.index.map(utils.format_asset))<EOL>print("<STR_LIT>")<EOL>utils.print_table(<EOL>max_days_by_ticker[max_days_by_ticker.days_to_liquidate ><EOL>days_to_liquidate_limit])<EOL>max_days_by_ticker_lnd = capacity.get_max_days_to_liquidate_by_ticker(<EOL>positions, market_data,<EOL>max_bar_consumption=liquidation_daily_vol_limit,<EOL>capital_base=<NUM_LIT>,<EOL>mean_volume_window=<NUM_LIT:5>,<EOL>last_n_days=last_n_days)<EOL>max_days_by_ticker_lnd.index = (<EOL>max_days_by_ticker_lnd.index.map(utils.format_asset))<EOL>print("<STR_LIT>".format(last_n_days))<EOL>utils.print_table(<EOL>max_days_by_ticker_lnd[max_days_by_ticker_lnd.days_to_liquidate > <NUM_LIT:1>])<EOL>llt = capacity.get_low_liquidity_transactions(transactions, market_data)<EOL>llt.index = llt.index.map(utils.format_asset)<EOL>print('<STR_LIT>'<EOL>'<STR_LIT>'.format(trade_daily_vol_limit * <NUM_LIT:100>))<EOL>utils.print_table(<EOL>llt[llt['<STR_LIT>'] > trade_daily_vol_limit * <NUM_LIT:100>])<EOL>llt = capacity.get_low_liquidity_transactions(<EOL>transactions, market_data, last_n_days=last_n_days)<EOL>print("<STR_LIT>".format(last_n_days))<EOL>utils.print_table(<EOL>llt[llt['<STR_LIT>'] > trade_daily_vol_limit * <NUM_LIT:100>])<EOL>bt_starting_capital = positions.iloc[<NUM_LIT:0>].sum() / (<NUM_LIT:1> + returns.iloc[<NUM_LIT:0>])<EOL>fig, ax_capacity_sweep = plt.subplots(figsize=(<NUM_LIT>, <NUM_LIT:6>))<EOL>plotting.plot_capacity_sweep(returns, transactions, market_data,<EOL>bt_starting_capital,<EOL>min_pv=<NUM_LIT>,<EOL>max_pv=<NUM_LIT>,<EOL>step_size=<NUM_LIT>,<EOL>ax=ax_capacity_sweep)<EOL>
Generates a report detailing portfolio size constraints set by
least liquid tickers. Plots a "capacity sweep," a curve describing
projected sharpe ratio given the slippage penalties that are
applied at various capital bases.

Parameters
----------
returns : pd.Series
    Daily returns of the strategy, noncumulative.
     - See full explanation in create_full_tear_sheet.
positions : pd.DataFrame
    Daily net position values.
     - See full explanation in create_full_tear_sheet.
transactions : pd.DataFrame
    Prices and amounts of executed trades. One row per trade.
     - See full explanation in create_full_tear_sheet.
market_data : pd.Panel
    Panel with items axis of 'price' and 'volume' DataFrames.
    The major and minor axes should match those of the
    the passed positions DataFrame (same dates and symbols).
liquidation_daily_vol_limit : float
    Max proportion of a daily bar that can be consumed in the
    process of liquidating a position in the
    "days to liquidation" analysis.
trade_daily_vol_limit : float
    Flag daily transaction totals that exceed proportion of
    daily bar.
last_n_days : integer
    Compute max position allocation and dollar volume for only
    the last N days of the backtest
days_to_liquidate_limit : integer
    Display all tickers with greater max days to liquidation.
estimate_intraday: boolean or str, optional
    Approximate returns for intraday strategies.
    See description in create_full_tear_sheet.