'Handles the close of the given minute in minute emission.
Parameters
dt : Timestamp
The minute that is ending
Returns
A minute perf packet.'

def handle_minute_close(self, dt, data_portal):

    self.position_tracker.sync_last_sale_prices(dt, False, data_portal)
    self.update_performance()
    todays_date = normalize_date(dt)
    account = self.get_account(False)
    bench_returns = self.all_benchmark_returns.loc[todays_date:dt]
    bench_since_open = ((1.0 + bench_returns).prod() - 1)
    self.cumulative_risk_metrics.update(todays_date, self.todays_performance.returns, bench_since_open, account.leverage)
    minute_packet = self.to_dict(emission_type='minute')
    return minute_packet
