Merge branch 'develop'

This commit is contained in:
fredfortier
2017-11-04 16:48:59 -04:00
3 changed files with 53 additions and 2 deletions
+1 -1
View File
@@ -435,7 +435,7 @@ class ExchangeBundle:
if end is None or (last_entry is not None and end > last_entry):
end = last_entry
if end is None or start is None or start >= end:
if end is None or start is None or start > end:
raise NoDataAvailableOnExchange(
exchange=[asset.exchange for asset in assets],
symbol=[asset.symbol for asset in assets],
+42
View File
@@ -0,0 +1,42 @@
import talib
import pandas as pd
from catalyst import run_algorithm
from catalyst.api import symbol
def initialize(context):
print('initializing')
context.asset = symbol('xcp_btc')
def handle_data(context, data):
print('handling bar: {}'.format(data.current_dt))
price = data.current(context.asset, 'close')
print('got price {price}'.format(price=price))
try:
prices = data.history(
context.asset,
fields='close',
bar_count=1,
frequency='1D'
)
print('got {} price entries\n'.format(len(prices), prices))
except Exception as e:
print(e)
run_algorithm(
capital_base=1,
start=pd.to_datetime('2015-3-2', utc=True),
end=pd.to_datetime('2017-8-31', utc=True),
data_frequency='daily',
initialize=initialize,
handle_data=handle_data,
analyze=None,
exchange_name='poloniex',
algo_namespace='issue_55',
base_currency='btc'
)
+10 -1
View File
@@ -2,9 +2,18 @@
Release Notes
=============
Version 0.3.6
^^^^^^^^^^^^^
**Release Date**: 2017-11-4
Bug Fixes
~~~~~~~~~
- Fixed an issue with single bar data.history() (:issue:`55`)
Version 0.3.5
^^^^^^^^^^^^^
**Release Date**: 2017-11-2
**Release Date**: 2017-11-4
Bug Fixes
~~~~~~~~~