Updated log messages for freqtradebot

This commit is contained in:
Sam Germain 2021-09-08 01:48:22 -06:00
parent 3057a5b9b8
commit 53006db2b7
2 changed files with 8 additions and 8 deletions

View File

@ -387,7 +387,7 @@ class FreqtradeBot(LoggingMixin):
logger.warning('Unable to create trade for %s: %s', pair, exception)
if not trades_created:
logger.debug("Found no buy signals for whitelisted currencies. Trying again...")
logger.debug("Found no enter signals for whitelisted currencies. Trying again...")
return trades_created
@ -687,7 +687,7 @@ class FreqtradeBot(LoggingMixin):
trades_closed += 1
except DependencyException as exception:
logger.warning('Unable to sell trade %s: %s', trade.pair, exception)
logger.warning('Unable to exit trade %s: %s', trade.pair, exception)
# Updating wallets if any trade occurred
if trades_closed:
@ -1081,7 +1081,7 @@ class FreqtradeBot(LoggingMixin):
return wallet_amount
else:
raise DependencyException(
f"Not enough amount to sell. Trade-amount: {amount}, Wallet: {wallet_amount}")
f"Not enough amount to exit trade. Trade-amount: {amount}, Wallet: {wallet_amount}")
def execute_trade_exit(self, trade: Trade, limit: float, sell_reason: SellCheckTuple) -> bool:
"""

View File

@ -1200,7 +1200,7 @@ def test_create_stoploss_order_invalid_order(mocker, default_conf, caplog, fee,
assert trade.stoploss_order_id is None
assert trade.sell_reason == SellType.EMERGENCY_SELL.value
assert log_has("Unable to place a stoploss order on exchange. ", caplog)
assert log_has("Selling the trade forcefully", caplog)
assert log_has("Exiting the trade forcefully", caplog)
# Should call a market sell
assert create_order_mock.call_count == 2
@ -1680,7 +1680,7 @@ def test_enter_positions(mocker, default_conf, caplog) -> None:
MagicMock(return_value=False))
n = freqtrade.enter_positions()
assert n == 0
assert log_has('Found no buy signals for whitelisted currencies. Trying again...', caplog)
assert log_has('Found no enter signals for whitelisted currencies. Trying again...', caplog)
# create_trade should be called once for every pair in the whitelist.
assert mock_ct.call_count == len(default_conf['exchange']['pair_whitelist'])
caplog.clear()
@ -1743,7 +1743,7 @@ def test_exit_positions_exception(mocker, default_conf, limit_buy_order, caplog)
)
n = freqtrade.exit_positions(trades)
assert n == 0
assert log_has('Unable to sell trade ETH/BTC: ', caplog)
assert log_has('Unable to exit trade ETH/BTC: ', caplog)
caplog.clear()
@ -3376,7 +3376,7 @@ def test__safe_exit_amount(default_conf, fee, caplog, mocker):
caplog.clear()
def test__safe_exit_amount_error(default_conf, fee, caplog, mocker):
def test_safe_exit_amount_error(default_conf, fee, caplog, mocker):
patch_RPCManager(mocker)
patch_exchange(mocker)
amount = 95.33
@ -3393,7 +3393,7 @@ def test__safe_exit_amount_error(default_conf, fee, caplog, mocker):
)
freqtrade = FreqtradeBot(default_conf)
patch_get_signal(freqtrade)
with pytest.raises(DependencyException, match=r"Not enough amount to sell."):
with pytest.raises(DependencyException, match=r"Not enough amount to exit."):
assert freqtrade._safe_exit_amount(trade.pair, trade.amount)