コード例 #1
0
    def setUpClass(cls):
        random.seed(0)
        cls.sids = (1, 2, 3)

        minute_sim_ps = factory.create_simulation_parameters(
            num_days=3,
            sids=cls.sids,
            data_frequency='minute',
            emission_rate='minute',
        )
        daily_sim_ps = factory.create_simulation_parameters(
            num_days=30,
            sids=cls.sids,
            data_frequency='daily',
            emission_rate='daily',
        )
        cls.sim_and_source = {
            'minute': (minute_sim_ps,
                       factory.create_minutely_trade_source(
                           cls.sids,
                           sim_params=minute_sim_ps,
                       )),
            'daily': (daily_sim_ps,
                      factory.create_trade_source(
                          cls.sids,
                          trade_time_increment=timedelta(days=1),
                          sim_params=daily_sim_ps,
                      )),
        }
コード例 #2
0
 def setUpClass(cls):
     random.seed(0)
     cls.sids = (1, 2, 3)
     minute_sim_ps = factory.create_simulation_parameters(
         num_days=3,
         data_frequency='minute',
         emission_rate='minute',
     )
     daily_sim_ps = factory.create_simulation_parameters(
         num_days=30,
         data_frequency='daily',
         emission_rate='daily',
     )
     cls.env = TradingEnvironment()
     cls.env.write_data(equities_identifiers=[1, 2, 3])
     cls.sim_and_source = {
         'minute': (minute_sim_ps,
                    factory.create_minutely_trade_source(
                        cls.sids,
                        sim_params=minute_sim_ps,
                        env=cls.env,
                    )),
         'daily': (daily_sim_ps,
                   factory.create_trade_source(
                       cls.sids,
                       trade_time_increment=timedelta(days=1),
                       sim_params=daily_sim_ps,
                       env=cls.env,
                   )),
     }
コード例 #3
0
ファイル: test_transforms.py プロジェクト: 1TTT9/zipline
    def setUpClass(cls):
        random.seed(0)
        cls.sids = (1, 2, 3)

        minute_sim_ps = factory.create_simulation_parameters(
            num_days=3,
            sids=cls.sids,
            data_frequency='minute',
            emission_rate='minute',
        )
        daily_sim_ps = factory.create_simulation_parameters(
            num_days=30,
            sids=cls.sids,
            data_frequency='daily',
            emission_rate='daily',
        )
        cls.sim_and_source = {
            'minute': (minute_sim_ps, factory.create_minutely_trade_source(
                cls.sids,
                trade_count=45,
                sim_params=minute_sim_ps,
            )),
            'daily': (daily_sim_ps, factory.create_trade_source(
                cls.sids,
                trade_count=90,
                trade_time_increment=timedelta(days=1),
                sim_params=daily_sim_ps,
            )),
        }
コード例 #4
0
ファイル: test_algorithm.py プロジェクト: erain/zipline
    def setUp(self):
        setup_logger(self)

        sids = [1, 2]
        self.sim_params = factory.create_simulation_parameters(num_days=2,
                                                               sids=sids)
        self.source = factory.create_minutely_trade_source(
            sids,
            trade_count=100,
            sim_params=self.sim_params,
            concurrent=True,
        )
コード例 #5
0
ファイル: test_algorithm.py プロジェクト: aavanian/zipline
 def setUp(self):
     setup_logger(self)
     sids = [1, 2]
     self.sim_params = factory.create_simulation_parameters(
         num_days=2,
         data_frequency='minute',
         emission_rate='minute',
     )
     self.source = factory.create_minutely_trade_source(
         sids,
         sim_params=self.sim_params,
         concurrent=True,
     )
コード例 #6
0
ファイル: test_transforms.py プロジェクト: Joshua2014/zipline
    def setUpClass(cls):
        random.seed(0)
        cls.sids = (1, 2, 3)

        minute_sim_ps = factory.create_simulation_parameters(
            num_days=3, data_frequency="minute", emission_rate="minute"
        )
        daily_sim_ps = factory.create_simulation_parameters(num_days=30, data_frequency="daily", emission_rate="daily")
        cls.sim_and_source = {
            "minute": (minute_sim_ps, factory.create_minutely_trade_source(cls.sids, sim_params=minute_sim_ps)),
            "daily": (
                daily_sim_ps,
                factory.create_trade_source(cls.sids, trade_time_increment=timedelta(days=1), sim_params=daily_sim_ps),
            ),
        }
コード例 #7
0
ファイル: test_transforms.py プロジェクト: testmana2/zipline
 def setUpClass(cls):
     random.seed(0)
     cls.sids = (1, 2, 3)
     minute_sim_ps = factory.create_simulation_parameters(
         num_days=3, data_frequency="minute", emission_rate="minute"
     )
     daily_sim_ps = factory.create_simulation_parameters(num_days=30, data_frequency="daily", emission_rate="daily")
     cls.env = TradingEnvironment()
     cls.env.write_data(equities_identifiers=[1, 2, 3])
     cls.sim_and_source = {
         "minute": (
             minute_sim_ps,
             factory.create_minutely_trade_source(cls.sids, sim_params=minute_sim_ps, env=cls.env),
         ),
         "daily": (
             daily_sim_ps,
             factory.create_trade_source(
                 cls.sids, trade_time_increment=timedelta(days=1), sim_params=daily_sim_ps, env=cls.env
             ),
         ),
     }