def __init__(self, config, exchange_type):
        self.config = config

        if CONFIG_BACKTESTING not in self.config:
            raise Exception("Backtesting config not found")

        self.symbols = None
        self.data = None
        self._get_symbol_list()

        self.config_time_frames = TimeFrameManager.get_config_time_frame(config)

        self.time_frame_get_times = {}
        self.tickers = {}
        self.fetched_trades = {}
        self.fetched_trades_counter = {}

        self.DEFAULT_LIMIT = 100
        self.MIN_LIMIT = 20

        self.MIN_ENABLED_TIME_FRAME = TimeFrameManager.find_config_min_time_frame(self.config_time_frames)
        self.DEFAULT_TIME_FRAME_RECENT_TRADE_CREATOR = self.MIN_ENABLED_TIME_FRAME
        self.CREATED_TRADES_BY_TIME_FRAME = 50
        self.DEFAULT_TIME_FRAME_TICKERS_CREATOR = self.MIN_ENABLED_TIME_FRAME
        self.CREATED_TICKER_BY_TIME_FRAME = 1

        self.backtesting = Backtesting(config, self)
        self._prepare()

        super().__init__(config, exchange_type, connect_to_online_exchange=False)
Example #2
0
    def __init__(self, config, exchange_type):
        self.config = config

        if CONFIG_BACKTESTING not in self.config:
            raise Exception("Backtesting config not found")

        self.symbols = None
        self.data = None
        self._get_symbol_list()

        self.config_time_frames = TimeFrameManager.get_config_time_frame(
            config)

        self.time_frame_get_times = {}
        self.tickers = {}
        self.fetched_trades = {}
        self.fetched_trades_counter = {}

        self.DEFAULT_LIMIT = 100
        self.MIN_LIMIT = 20

        self.MIN_ENABLED_TIME_FRAME = TimeFrameManager.find_config_min_time_frame(
            self.config_time_frames)
        self.DEFAULT_TIME_FRAME_RECENT_TRADE_CREATOR = self.MIN_ENABLED_TIME_FRAME
        self.CREATED_TRADES_BY_TIME_FRAME = 50
        self.DEFAULT_TIME_FRAME_TICKERS_CREATOR = self.MIN_ENABLED_TIME_FRAME
        self.CREATED_TICKER_BY_TIME_FRAME = 1

        self.backtesting = Backtesting(config, self)
        self._prepare()

        super().__init__(config,
                         exchange_type,
                         connect_to_online_exchange=False)
    def set_default_config(self):
        time_frames = self.exchange.get_config_time_frame()
        min_time_frame = TimeFrameManager.find_config_min_time_frame(time_frames)

        self.specific_config = {
            CONFIG_TIME_FRAME: min_time_frame,
            CONFIG_REFRESH_RATE: TimeFramesMinutes[min_time_frame] / 6 * MINUTE_TO_SECONDS,
        }
Example #4
0
    def set_default_config(self):
        time_frames = self.exchange.get_config_time_frame()
        min_time_frame = TimeFrameManager.find_config_min_time_frame(
            time_frames)

        self.specific_config = {
            CONFIG_TIME_FRAME:
            min_time_frame,
            CONFIG_REFRESH_RATE:
            TimeFramesMinutes[min_time_frame] / 6 * MINUTE_TO_SECONDS,
        }