Merge pull request #3552 from Theagainmen/Minor_issues
API server FIAT init fix
This commit is contained in:
commit
5a189ae202
@ -69,7 +69,7 @@ class AgeFilter(IPairList):
|
||||
return True
|
||||
else:
|
||||
self.log_on_refresh(logger.info, f"Removed {ticker['symbol']} from whitelist, "
|
||||
f"because age is less than "
|
||||
f"because age {len(daily_candles)} is less than "
|
||||
f"{self._min_days_listed} "
|
||||
f"{plural(self._min_days_listed, 'day')}")
|
||||
return False
|
||||
|
@ -17,6 +17,7 @@ from werkzeug.serving import make_server
|
||||
|
||||
from freqtrade.__init__ import __version__
|
||||
from freqtrade.rpc.rpc import RPC, RPCException
|
||||
from freqtrade.rpc.fiat_convert import CryptoToFiatConverter
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@ -105,6 +106,9 @@ class ApiServer(RPC):
|
||||
# Register application handling
|
||||
self.register_rest_rpc_urls()
|
||||
|
||||
if self._config.get('fiat_display_currency', None):
|
||||
self._fiat_converter = CryptoToFiatConverter()
|
||||
|
||||
thread = threading.Thread(target=self.run, daemon=True)
|
||||
thread.start()
|
||||
|
||||
|
@ -389,7 +389,7 @@ def test_VolumePairList_whitelist_gen(mocker, whitelist_conf, shitcoinmarkets, t
|
||||
for pairlist in pairlists:
|
||||
if pairlist['method'] == 'AgeFilter' and pairlist['min_days_listed'] and \
|
||||
len(ohlcv_history_list) <= pairlist['min_days_listed']:
|
||||
assert log_has_re(r'^Removed .* from whitelist, because age is less than '
|
||||
assert log_has_re(r'^Removed .* from whitelist, because age .* is less than '
|
||||
r'.* day.*', caplog)
|
||||
if pairlist['method'] == 'PrecisionFilter' and whitelist_result:
|
||||
assert log_has_re(r'^Removed .* from whitelist, because stop price .* '
|
||||
|
@ -431,14 +431,14 @@ def test_api_profit(botclient, mocker, ticker, fee, markets, limit_buy_order, li
|
||||
'latest_trade_date': 'just now',
|
||||
'latest_trade_timestamp': ANY,
|
||||
'profit_all_coin': 6.217e-05,
|
||||
'profit_all_fiat': 0,
|
||||
'profit_all_fiat': 0.76748865,
|
||||
'profit_all_percent': 6.2,
|
||||
'profit_all_percent_mean': 6.2,
|
||||
'profit_all_ratio_mean': 0.06201058,
|
||||
'profit_all_percent_sum': 6.2,
|
||||
'profit_all_ratio_sum': 0.06201058,
|
||||
'profit_closed_coin': 6.217e-05,
|
||||
'profit_closed_fiat': 0,
|
||||
'profit_closed_fiat': 0.76748865,
|
||||
'profit_closed_percent': 6.2,
|
||||
'profit_closed_ratio_mean': 0.06201058,
|
||||
'profit_closed_percent_mean': 6.2,
|
||||
|
Loading…
Reference in New Issue
Block a user