diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index f9f3a3678..cee217ed5 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -45,6 +45,10 @@ class SellType(Enum): EMERGENCY_SELL = "emergency_sell" NONE = "" + def __str__(self): + # explicitly convert to String to help with exporting data. + return self.value + class SellCheckTuple(NamedTuple): """ diff --git a/tests/test_freqtradebot.py b/tests/test_freqtradebot.py index 6496043f9..89991fde8 100644 --- a/tests/test_freqtradebot.py +++ b/tests/test_freqtradebot.py @@ -320,7 +320,7 @@ def test_edge_overrides_stoploss(limit_buy_order, fee, caplog, mocker, edge_conf # stoploss shoud be hit assert freqtrade.handle_trade(trade) is True - assert log_has('Executing Sell for NEO/BTC. Reason: SellType.STOP_LOSS', caplog) + assert log_has('Executing Sell for NEO/BTC. Reason: stop_loss', caplog) assert trade.sell_reason == SellType.STOP_LOSS.value