'Handle data function shared between test algos.'

def default_handle_data(self, assets, order_size):

    def handle_data(context, data):
        if (not context.ordered):
            for asset in assets:
                context.order(asset, order_size)
            context.ordered = True
        context.cash.append(context.portfolio.cash)
        context.num_positions.append(len(context.portfolio.positions))
    return handle_data
