diff --git a/catalyst/examples/mean_reversion_simple.py b/catalyst/examples/mean_reversion_simple.py index 642d705e..23ca036a 100644 --- a/catalyst/examples/mean_reversion_simple.py +++ b/catalyst/examples/mean_reversion_simple.py @@ -33,12 +33,12 @@ def initialize(context): # parameters or values you're going to use. # In our example, we're looking at Neo in Ether. - context.market = symbol('neo_eth') + context.market = symbol('eth_btc') context.base_price = None context.current_day = None - context.RSI_OVERSOLD = 30 - context.RSI_OVERBOUGHT = 80 + context.RSI_OVERSOLD = 40 + context.RSI_OVERBOUGHT = 65 context.CANDLE_SIZE = '5T' context.start_time = time.time() @@ -244,7 +244,7 @@ def analyze(context=None, perf=None): if __name__ == '__main__': # The execution mode: backtest or live - MODE = 'backtest' + MODE = 'live' if MODE == 'backtest': folder = os.path.join( @@ -274,15 +274,15 @@ if __name__ == '__main__': elif MODE == 'live': run_algorithm( - capital_base=0.05, + capital_base=0.03, initialize=initialize, handle_data=handle_data, analyze=analyze, - exchange_name='binance', + exchange_name='poloniex', live=True, algo_namespace=NAMESPACE, - base_currency='eth', + base_currency='btc', live_graph=False, - simulate_orders=True, - stats_output=None + simulate_orders=False, + stats_output=None, ) diff --git a/catalyst/exchange/ccxt/ccxt_exchange.py b/catalyst/exchange/ccxt/ccxt_exchange.py index 59d7bbf9..4d6667b1 100644 --- a/catalyst/exchange/ccxt/ccxt_exchange.py +++ b/catalyst/exchange/ccxt/ccxt_exchange.py @@ -114,9 +114,10 @@ class CCXT(Exchange): @staticmethod def find_exchanges(features=None, is_authenticated=False): ccxt_features = [] - for feature in features: - if not feature.endswith('Bundle'): - ccxt_features.append(feature) + if features is not None: + for feature in features: + if not feature.endswith('Bundle'): + ccxt_features.append(feature) exchange_names = [] for exchange_name in ccxt.exchanges: diff --git a/catalyst/exchange/utils/factory.py b/catalyst/exchange/utils/factory.py index c5503582..17499442 100644 --- a/catalyst/exchange/utils/factory.py +++ b/catalyst/exchange/utils/factory.py @@ -84,13 +84,14 @@ def find_exchanges(features=None, skip_blacklist=True, is_authenticated=False, base_currency=base_currency, ) - if 'dailyBundle' in features \ - and not exchange.has_bundle('daily'): - continue + if features is not None: + if 'dailyBundle' in features \ + and not exchange.has_bundle('daily'): + continue - elif 'minuteBundle' in features \ - and not exchange.has_bundle('minute'): - continue + elif 'minuteBundle' in features \ + and not exchange.has_bundle('minute'): + continue exchanges.append(exchange) diff --git a/tests/exchange/test_suite_bundle.py b/tests/exchange/test_suite_bundle.py index 07e94e4f..94952b9c 100644 --- a/tests/exchange/test_suite_bundle.py +++ b/tests/exchange/test_suite_bundle.py @@ -96,11 +96,12 @@ class TestSuiteBundle: ) def test_validate_bundles(self): - exchange_population = 3 + # exchange_population = 3 asset_population = 3 data_frequency = random.choice(['minute', 'daily']) - bundle = 'dailyBundle' if data_frequency == 'daily' else 'minuteBundle' + # bundle = 'dailyBundle' if data_frequency + # == 'daily' else 'minuteBundle' # exchanges = select_random_exchanges( # population=exchange_population, # features=[bundle],