BLD: for issue #178, fixed the "set" issue when fetching a ticker from positions

This commit is contained in:
Frederic Fortier
2018-01-31 16:32:22 -05:00
parent 311e357451
commit 69507d1b00
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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: