From 40cfc65e02cbc0d9688d0dd0a90b6fed71ab4bec Mon Sep 17 00:00:00 2001 From: Frederic Fortier Date: Thu, 1 Mar 2018 23:33:17 -0500 Subject: [PATCH] BUG: fixed python2 syntax --- catalyst/support/issue_236.py | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/catalyst/support/issue_236.py b/catalyst/support/issue_236.py index c3a437a9..3dd8a960 100644 --- a/catalyst/support/issue_236.py +++ b/catalyst/support/issue_236.py @@ -1,7 +1,8 @@ from catalyst.api import symbol from catalyst.utils.run_algo import run_algorithm -coins = ['dash', 'btc', 'dash', 'etc', 'eth', 'ltc', 'nxt', 'rep', 'str', 'xmr', 'xrp', 'zec'] +coins = ['dash', 'btc', 'dash', 'etc', 'eth', 'ltc', 'nxt', 'rep', 'str', + 'xmr', 'xrp', 'zec'] symbols = None @@ -13,20 +14,21 @@ def _handle_data(context, data): global symbols if symbols is None: symbols = [symbol(c + '_usdt') for c in coins] - print'getting history for: %s' % [s.symbol for s in symbols] + print('getting history for: %s' % [s.symbol for s in symbols]) history = data.history(symbols, - ['close', 'volume'], - bar_count=1, # EXCEPTION, Change to 2 - frequency='5T') - #print 'history: %s' % history.shape + ['close', 'volume'], + bar_count=1, # EXCEPTION, Change to 2 + frequency='5T') + # print 'history: %s' % history.shape + run_algorithm(initialize=initialize, handle_data=_handle_data, - analyze=lambda _, results: True, - exchange_name='poloniex', - base_currency='usdt', - algo_namespace='issue-236', - live=True, - data_frequency='minute', - capital_base=3000, - simulate_orders=True) \ No newline at end of file + analyze=lambda _, results: True, + exchange_name='poloniex', + base_currency='usdt', + algo_namespace='issue-236', + live=True, + data_frequency='minute', + capital_base=3000, + simulate_orders=True)