mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-30 12:53:36 +08:00
BLD: for issue #178, fixed the "set" issue when fetching a ticker from positions
This commit is contained in:
@@ -998,13 +998,13 @@ class CCXT(Exchange):
|
||||
|
||||
"""
|
||||
if len(assets) == 1:
|
||||
symbol = self.get_symbol(assets[0])
|
||||
try:
|
||||
symbol = self.get_symbol(assets[0])
|
||||
log.debug('fetching single ticker: {}'.format(symbol))
|
||||
results = dict()
|
||||
results[symbol] = self.api.fetch_ticker(symbol=symbol)
|
||||
|
||||
except (ExchangeError, NetworkError) as e:
|
||||
except (ExchangeError, NetworkError, Exception) as e:
|
||||
log.warn(
|
||||
'unable to fetch ticker {} / {}: {}'.format(
|
||||
self.name, symbol, e
|
||||
|
||||
@@ -703,7 +703,7 @@ class Exchange:
|
||||
|
||||
positions_value = 0.0
|
||||
if positions:
|
||||
assets = set([position.asset for position in positions])
|
||||
assets = list(set([position.asset for position in positions]))
|
||||
tickers = self.tickers(assets)
|
||||
|
||||
for position in positions:
|
||||
|
||||
Reference in New Issue
Block a user