Reading data from bundles first and other fixes

This commit is contained in:
fredfortier
2017-10-11 00:13:22 -04:00
parent 83af12c52c
commit d3e33c44bf
8 changed files with 236 additions and 96 deletions
@@ -36,8 +36,8 @@ def _handle_data(context, data):
prices = data.history(
context.asset,
fields='price',
bar_count=30,
frequency='30m'
bar_count=50,
frequency='1m'
)
rsi = talib.RSI(prices.values, timeperiod=14)[-1]
log.info('got rsi: {}'.format(rsi))
@@ -148,27 +148,27 @@ def analyze(context, stats):
pass
# run_algorithm(
# initialize=initialize,
# handle_data=handle_data,
# analyze=analyze,
# exchange_name='bitfinex',
# live=True,
# algo_namespace=algo_namespace,
# base_currency='btc',
# live_graph=False
# )
# Backtest
run_algorithm(
capital_base=250,
start=pd.to_datetime('2017-09-08', utc=True),
end=pd.to_datetime('2017-09-15', utc=True),
data_frequency='minute',
initialize=initialize,
handle_data=handle_data,
analyze=analyze,
exchange_name='bitfinex',
live=True,
algo_namespace=algo_namespace,
base_currency='btc'
base_currency='btc',
live_graph=False
)
# Backtest
# run_algorithm(
# capital_base=250,
# start=pd.to_datetime('2017-09-08', utc=True),
# end=pd.to_datetime('2017-09-15', utc=True),
# data_frequency='minute',
# initialize=initialize,
# handle_data=handle_data,
# analyze=analyze,
# exchange_name='bitfinex',
# algo_namespace=algo_namespace,
# base_currency='btc'
# )