示例#1
0
    def setUp(self):
        """
        create two fake CSV files
        """
        self.csv_dir = gettempdir()
        self.symbol_list = ['FakeData1', 'FakeData2']
        self.start_dates = ['2014-05-05 17:30:00', '2014-05-10 17:30:00']
        self.end_dates = ['2014-05-20 17:30:00', '2014-05-15 17:30:00']

        for index, symbol in enumerate(self.symbol_list):
            make_fake_csv(save_to=self.csv_dir,
                          filename=symbol,
                          start_date=self.start_dates[index],
                          end_date=self.end_dates[index],
                          style='consecutive')

        self.event = queue.Queue()
        self.tested_handler = HistoricCSVDataHandler(events=self.event,
                                                     csv_dir=self.csv_dir,
                                                     symbol_list=self.
                                                     symbol_list)
示例#2
0
    def setUp(self):
        """
        create two fake CSV files using different start date
        to test correct reindex, also create market event.
        """
        self.csv_dir = gettempdir()
        self.symbol_list = ['FakeData1', 'FakeData2']
        self.start_dates = ['2014-05-05 17:30:00', '2014-05-10 17:30:00']
        self.end_dates = ['2014-05-20 17:30:00', '2014-05-15 17:30:00']

        for index, symbol in enumerate(self.symbol_list):
            make_fake_csv(save_to=self.csv_dir,
                          filename=symbol,
                          start_date=self.start_dates[index],
                          end_date=self.end_dates[index],
                          style=None)

        self.event = 'Market'
        self.tested_handler = HistoricCSVDataHandler(events=self.event,
                                                     csv_dir=self.csv_dir,
                                                     symbol_list=self.
                                                     symbol_list)