Fix bug causing /balance to fail
This commit is contained in:
@@ -13,6 +13,7 @@ import sqlalchemy as sql
|
||||
from numpy import mean, nan_to_num
|
||||
from pandas import DataFrame
|
||||
|
||||
from freqtrade import TemporaryError
|
||||
from freqtrade.fiat_convert import CryptoToFiatConverter
|
||||
from freqtrade.misc import shorten_date
|
||||
from freqtrade.persistence import Trade
|
||||
@@ -271,10 +272,13 @@ class RPC(object):
|
||||
if coin == 'BTC':
|
||||
rate = 1.0
|
||||
else:
|
||||
if coin == 'USDT':
|
||||
rate = 1.0 / self._freqtrade.exchange.get_ticker('BTC/USDT', False)['bid']
|
||||
else:
|
||||
rate = self._freqtrade.exchange.get_ticker(coin + '/BTC', False)['bid']
|
||||
try:
|
||||
if coin == 'USDT':
|
||||
rate = 1.0 / self._freqtrade.exchange.get_ticker('BTC/USDT', False)['bid']
|
||||
else:
|
||||
rate = self._freqtrade.exchange.get_ticker(coin + '/BTC', False)['bid']
|
||||
except TemporaryError:
|
||||
continue
|
||||
est_btc: float = rate * balance['total']
|
||||
total = total + est_btc
|
||||
output.append({
|
||||
|
Reference in New Issue
Block a user