def __init__(self, *args, **kwargs):
        self.algo_namespace = kwargs.pop('algo_namespace', None)
        self.live_graph = kwargs.pop('live_graph', None)
        self.stats_output = kwargs.pop('stats_output', None)
        self._analyze_live = kwargs.pop('analyze_live', None)

        self._clock = None
        self.frame_stats = list()

        self.pnl_stats = get_algo_df(self.algo_namespace, 'pnl_stats')

        self.custom_signals_stats = \
            get_algo_df(self.algo_namespace, 'custom_signals_stats')

        self.exposure_stats = \
            get_algo_df(self.algo_namespace, 'exposure_stats')

        self.is_running = True

        self.stats_minutes = 1

        self._last_orders = []
        self.trading_client = None

        super(ExchangeTradingAlgorithmLive, self).__init__(*args, **kwargs)

        try:
            signal.signal(signal.SIGINT, self.signal_handler)
        except ValueError:
            log.warn("Can't initialize signal handler inside another thread."
                     "Exit should be handled by the user.")

        log.info('initialized trading algorithm in live mode')
    def __init__(self, *args, **kwargs):
        self.algo_namespace = kwargs.pop('algo_namespace', None)
        self.live_graph = kwargs.pop('live_graph', None)
        self.stats_output = kwargs.pop('stats_output', None)
        self._analyze_live = kwargs.pop('analyze_live', None)
        self.start = kwargs.pop('start', None)
        self.is_start = kwargs.pop('is_start', True)
        self.end = kwargs.pop('end', None)
        self.is_end = kwargs.pop('is_end', True)

        self._clock = None
        self.frame_stats = list()

        # erase the frame_stats folder to avoid overloading the disk
        error = clear_frame_stats_directory(self.algo_namespace)
        if error:
            log.warning(error)

        # in order to save paper & live files separately
        self.mode_name = 'paper' if kwargs['simulate_orders'] else 'live'

        self.pnl_stats = get_algo_df(
            self.algo_namespace,
            'pnl_stats_{}'.format(self.mode_name),
        )

        self.custom_signals_stats = get_algo_df(
            self.algo_namespace,
            'custom_signals_stats_{}'.format(self.mode_name)
        )

        self.exposure_stats = get_algo_df(
            self.algo_namespace,
            'exposure_stats_{}'.format(self.mode_name)
        )

        self.is_running = True

        self.stats_minutes = 1

        self._last_orders = []
        self._last_open_orders = []
        self.trading_client = None

        super(ExchangeTradingAlgorithmLive, self).__init__(*args, **kwargs)

        try:
            signal.signal(signal.SIGINT, self.signal_handler)
        except ValueError:
            log.warn("Can't initialize signal handler inside another thread."
                     "Exit should be handled by the user.")