'algorithm_returns needs to be a list of daily_return objects
sorted in date ascending order
account needs to be a list of account objects sorted in date
ascending order'

def __init__(self, algorithm_returns, sim_params, trading_calendar, treasury_curves, benchmark_returns, algorithm_leverages=None):

    self.algorithm_returns = algorithm_returns
    self.sim_params = sim_params
    self.trading_calendar = trading_calendar
    self.treasury_curves = treasury_curves
    self.benchmark_returns = benchmark_returns
    self.algorithm_leverages = algorithm_leverages
    if (len(self.algorithm_returns) == 0):
        start_session = self.sim_params.start_session
        end_session = self.sim_params.end_session
    else:
        start_session = self.algorithm_returns.index[0]
        end_session = self.algorithm_returns.index[(-1)]
    self.month_periods = self.periods_in_range(1, start_session, end_session)
    self.three_month_periods = self.periods_in_range(3, start_session, end_session)
    self.six_month_periods = self.periods_in_range(6, start_session, end_session)
    self.year_periods = self.periods_in_range(12, start_session, end_session)
