mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-11 11:16:15 +08:00
BUG: fixed on issue #55 with single history bar
This commit is contained in:
@@ -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],
|
||||
|
||||
@@ -19,11 +19,11 @@ def handle_data(context, data):
|
||||
try:
|
||||
prices = data.history(
|
||||
context.asset,
|
||||
fields='price',
|
||||
fields='close',
|
||||
bar_count=1,
|
||||
frequency='1D'
|
||||
)
|
||||
print('got {} price entries'.format(len(prices)))
|
||||
print('got {} price entries\n'.format(len(prices), prices))
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user