Example #1
0
    def __init__(self,
                 security_type=SecurityType.coin,
                 exchanges=['binance'],
                 codes=None,
                 batch_size=10,
                 force_update=False,
                 sleeping_time=5,
                 fetching_style=TimeSeriesFetchingStyle.end_size,
                 default_size=2000,
                 contain_unfinished_data=False,
                 level=TradingLevel.LEVEL_1DAY,
                 one_shot=False,
                 start_timestamp=None) -> None:
        self.data_schema = get_kdata_schema(security_type=security_type,
                                            level=level)

        self.ccxt_trading_level = to_ccxt_trading_level(level)
        self.start_timestamp = to_pd_timestamp(start_timestamp)

        super().__init__(security_type,
                         exchanges,
                         codes,
                         batch_size,
                         force_update,
                         sleeping_time,
                         fetching_style,
                         default_size,
                         contain_unfinished_data,
                         level,
                         one_shot,
                         kdata_use_begin_time=True)
Example #2
0
    def __init__(self,
                 exchanges=['binance'],
                 entity_ids=None,
                 codes=None,
                 batch_size=10,
                 force_update=False,
                 sleeping_time=10,
                 default_size=2000,
                 one_shot=False,
                 fix_duplicate_way='add',
                 start_timestamp=None,
                 end_timestamp=None,
                 contain_unfinished_data=False,
                 level=IntervalLevel.LEVEL_1DAY,
                 kdata_use_begin_time=True,
                 close_hour=0,
                 close_minute=0,
                 one_day_trading_minutes=24 * 60) -> None:
        self.data_schema = get_kdata_schema(entity_type='coin', level=level)
        self.ccxt_trading_level = to_ccxt_trading_level(level)

        super().__init__('coin', exchanges, entity_ids, codes, batch_size,
                         force_update, sleeping_time, default_size, one_shot,
                         fix_duplicate_way, start_timestamp, end_timestamp,
                         contain_unfinished_data, level, kdata_use_begin_time,
                         close_hour, close_minute, one_day_trading_minutes)