Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

Exchange: support availabe spot values #335

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions catalyst/exchange/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,13 @@ def get_spot_value(self, assets, field, dt=None, data_frequency='minute'):
if field == 'close' or field == 'price':
return [tickers[asset]['last'] for asset in tickers]

elif field == 'volume':
return [tickers[asset]['volume'] for asset in tickers]

else:
raise NoValueForField(field=field)
result = []
for asset in tickers:
if field in tickers[asset]:
result.append(tickers[asset][field])
else:
raise NoValueForField(field=field)
return result

def get_single_spot_value(self, asset, field, data_frequency):
"""
Expand Down