diff --git a/catalyst/exchange/exchange_algorithm.py b/catalyst/exchange/exchange_algorithm.py index 16857b7ba..1701c10ff 100644 --- a/catalyst/exchange/exchange_algorithm.py +++ b/catalyst/exchange/exchange_algorithm.py @@ -974,9 +974,9 @@ def _process_stats(self, data): ) )) - # Saving the daily stats in a format usable for performance - # analysis. - daily_stats = self.prepare_period_stats( + # Since live mode does not use daily frequency, + # there is no need to save the output of this method. + self.prepare_period_stats( start_dt=today, end_dt=data.current_dt ) @@ -1044,7 +1044,9 @@ def analyze(self, perf): def run(self, data=None, overwrite_sim_params=True): data.attempts = self.attempts - perf = super(ExchangeTradingAlgorithmLive, self).run( + # Since live mode does not use daily frequency, + # there is no need to save the output of this method. + super(ExchangeTradingAlgorithmLive, self).run( data, overwrite_sim_params ) # Rebuilding the stats to support minute data diff --git a/catalyst/support/buy_and_sell_test.py b/catalyst/support/buy_and_sell_test.py index 8fbfff3db..c3fddce8f 100644 --- a/catalyst/support/buy_and_sell_test.py +++ b/catalyst/support/buy_and_sell_test.py @@ -27,8 +27,8 @@ def initialize(context): - # context.asset = symbol('btc_usdt') - context.asset = symbol('etc_btc') + context.asset = symbol('btc_usdt') + # context.asset = symbol('etc_btc') context.i = 0 # context.set_commission(maker=0.4,taker=0.3) @@ -72,9 +72,9 @@ def handle_data(context, data): algo_namespace='buy_btc_simple', quote_currency='btc', live=True, - simulate_orders=False, + # simulate_orders=False, # start=pd.to_datetime('2018-05-01 17:18', utc=True), - # end=pd.to_datetime('2017-10-31', utc=True), + end=pd.to_datetime('2018-05-14 08:28', utc=True), ) else: run_algorithm( @@ -85,9 +85,6 @@ def handle_data(context, data): exchange_name='poloniex', algo_namespace='buy_btc_simple', quote_currency='usdt', - # live=True, - # simulate_orders=False, start=pd.to_datetime('2016-01-01', utc=True), end=pd.to_datetime('2016-01-03', utc=True), - # end=pd.to_datetime('2018-05-02 18:42', utc=True), )