PortfolioBacktest

class src.boatwright.PortfolioBacktest.PortfolioBacktest(data_dict, strategy_dict, broker_dict)

takes several dataframes, presumably for a portfolio of assets, conducts backtest for each

Parameters:
  • data_dict (dict) – dictionary with keys of asset symbols (e.g. “AAPL” or “BTC”) and items of candle bar data as pd.DataFrames

  • strategy_dict – either a dictionary with keys of asset symbols, and items of distinct boatwright.Strategies, or a boatwright.Strategy which is then applied to all assets

  • broker_dict – either a dictionary with keys of asset symbols, and items of distinct boatwright.Brokers.BacktestBrokers, or a boatwright.Brokers.BacktestBroker which is then applied to all assets

divide_portfolio(split_dict, starting_aum)

assigns a fractional portion of the starting_aum to each strategies broker

Parameters:
  • split_dict (dict) – dictionary with asset symbols as keys and items of type float indicating the fraction of starting_aum to be assigned

  • starting_aum (float) – total starting value of the portfolio

Returns:

None

run(executor=<src.boatwright.BacktestExecutors.SequentialExecutor.SequentialExecutor object>, verbose=False)

runs the backtests

Parameters:
Verbose:

boolean toggle to print backtest progress bars to terminal

Returns:

None