def make_data(self, auto_close_delta, frequency,
                  capital_base=float("1.0e5")):

        asset_info = make_jagged_equity_info(
            num_assets=3,
            start_date=self.test_days[0],
            first_end=self.first_asset_expiration,
            frequency=trading_day,
            periods_between_ends=2,
            auto_close_delta=auto_close_delta,
        )

        sids = asset_info.index

        env = self.enter_instance_context(tmp_trading_env(equities=asset_info))
        market_opens = env.open_and_closes.market_open.loc[self.test_days]
        market_closes = env.open_and_closes.market_close.loc[self.test_days]

        if frequency == 'daily':
            dates = self.test_days
            trade_data_by_sid = make_trade_data_for_asset_info(
                dates=dates,
                asset_info=asset_info,
                price_start=10,
                price_step_by_sid=10,
                price_step_by_date=1,
                volume_start=100,
                volume_step_by_sid=100,
                volume_step_by_date=10,
                frequency=frequency
            )
            path = self.tmpdir.getpath("testdaily.bcolz")
            BcolzDailyBarWriter(path, dates).write(
                iteritems(trade_data_by_sid),
            )
            data_portal = DataPortal(
                env,
                equity_daily_reader=BcolzDailyBarReader(path)
            )
        elif frequency == 'minute':
            dates = env.minutes_for_days_in_range(
                self.test_days[0],
                self.test_days[-1],
            )
            writer = BcolzMinuteBarWriter(
                self.test_days[0],
                self.tmpdir.path,
                market_opens,
                market_closes,
                US_EQUITIES_MINUTES_PER_DAY
            )
            trade_data_by_sid = make_trade_data_for_asset_info(
                writer=writer,
                dates=dates,
                asset_info=asset_info,
                price_start=10,
                price_step_by_sid=10,
                price_step_by_date=1,
                volume_start=100,
                volume_step_by_sid=100,
                volume_step_by_date=10,
                frequency=frequency
            )
            data_portal = DataPortal(
                env,
                equity_minute_reader=BcolzMinuteBarReader(self.tmpdir.path)
            )
        else:
            self.fail(frequency % "Unknown frequency in make_data: %r")

        assets = env.asset_finder.retrieve_all(sids)

        sim_params = factory.create_simulation_parameters(
            start=self.test_days[0],
            end=self.test_days[-1],
            data_frequency=frequency,
            emission_rate=frequency,
            env=env,
            capital_base=capital_base,
        )

        if frequency == 'daily':
            final_prices = {
                asset.sid: trade_data_by_sid[asset.sid].
                loc[asset.end_date].close
                for asset in assets
            }
        else:
            final_prices = {
                asset.sid: trade_data_by_sid[asset.sid].loc[
                    env.get_open_and_close(asset.end_date)[1]
                ].close
                for asset in assets
            }

        TestData = namedtuple(
            'TestData',
            [
                'asset_info',
                'assets',
                'env',
                'data_portal',
                'final_prices',
                'trade_data_by_sid',
                'sim_params'
            ],
        )
        return TestData(
            asset_info=asset_info,
            assets=assets,
            env=env,
            data_portal=data_portal,
            final_prices=final_prices,
            trade_data_by_sid=trade_data_by_sid,
            sim_params=sim_params
        )
dataset/ETHPy150Open quantopian/zipline/tests/test_algorithm.py/TestEquityAutoClose.make_data/swapped operands of `%`