Simulator

WORK IN PROGRESS

class cvxportfolio.MarketSimulator(market_returns, costs, market_volumes=None, cash_key='cash')

Attributes

logger  

Methods

run_backtest(initial_portfolio, start_time, end_time, policy, loglevel=30)

Backtest a single policy.

run_multiple_backtest(initial_portf, start_time, end_time, policies, loglevel=30, parallel=True)

Backtest multiple policies.

what_if(time, results, alt_policies, parallel=True)

Run alternative policies starting from given time.

attribute(true_results, policy, selector=None, delta=1, fit='linear', parallel=True)

Attributes returns over a period to individual alpha sources.

Args:

true_results: observed results. policy: the policy that achieved the returns.

Alpha model must be a stream.

selector: A map from SimulationResult to time series. delta: the fractional deviation. fit: the type of fit to perform.

Returns:
A dict of alpha source to return series.