Documentation and cleanup from meeting with Victor

This commit is contained in:
fredfortier
2017-09-15 18:00:15 -04:00
parent ff0dc5cff9
commit 5a345a3abb
11 changed files with 32 additions and 15 deletions
@@ -30,7 +30,7 @@ def initialize(context):
# the exchange information. This allow all other operations using
# the TradingPair to target the correct exchange.
context.trading_pairs[context.buying_exchange] = \
symbol(context.trading_pair_symbol, context.buying_exchange.name)
symbol('neo_eth', context.buying_exchange.name)
context.trading_pairs[context.selling_exchange] = \
symbol(context.trading_pair_symbol, context.selling_exchange.name)
+8 -5
View File
@@ -38,6 +38,8 @@ def initialize(context):
context.retry_update_portfolio = 10
context.retry_order = 5
context.swallow_errors = True
context.errors = []
pass
@@ -49,6 +51,7 @@ def _handle_data(context, data):
bar_count=20,
frequency='15m'
)
rsi = talib.RSI(prices.values, timeperiod=14)[-1]
log.info('got rsi: {}'.format(rsi))
@@ -135,11 +138,11 @@ def _handle_data(context, data):
def handle_data(context, data):
log.info('handling bar {}'.format(data.current_dt))
# try:
_handle_data(context, data)
# except Exception as e:
# log.warn('aborting the bar on error {}'.format(e))
# context.errors.append(e)
try:
_handle_data(context, data)
except Exception as e:
log.warn('aborting the bar on error {}'.format(e))
context.errors.append(e)
log.info('completed bar {}, total execution errors {}'.format(
data.current_dt,