def __init__(self, *args, **kwargs): self.algo_namespace = kwargs.pop('algo_namespace', None) self.live_graph = kwargs.pop('live_graph', None) self._clock = None self.minute_stats = deque(maxlen=60) 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.retry_check_open_orders = 5 self.retry_synchronize_portfolio = 5 self.retry_get_open_orders = 5 self.retry_order = 2 self.retry_delay = 5 self.stats_minutes = 5 super(ExchangeTradingAlgorithmLive, self).__init__(*args, **kwargs) # TODO: fix precision before re-enabling # self._create_minute_writer() signal.signal(signal.SIGINT, self.signal_handler) 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._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.retry_check_open_orders = 5 self.retry_synchronize_portfolio = 5 self.retry_get_open_orders = 5 self.retry_order = 2 self.retry_delay = 5 self.stats_minutes = 10 super(ExchangeTradingAlgorithmLive, self).__init__(*args, **kwargs) signal.signal(signal.SIGINT, self.signal_handler) log.info('initialized trading algorithm in live mode')
def __init__(self, *args, **kwargs): self.exchange = kwargs.pop('exchange', None) self.algo_namespace = kwargs.pop('algo_namespace', None) self.live_graph = kwargs.pop('live_graph', None) self._clock = None self.minute_stats = deque(maxlen=60) 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.retry_check_open_orders = 5 self.retry_synchronize_portfolio = 5 self.retry_get_open_orders = 5 self.retry_order = 2 self.retry_delay = 5 self.stats_minutes = 5 super(self.__class__, self).__init__(*args, **kwargs) # self._create_minute_writer() signal.signal(signal.SIGINT, self.signal_handler) log.info('exchange trading algorithm successfully initialized')