From 4cd4edf08b19d4d0a1d48b3d4f9f28be95272b48 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 4 Apr 2022 19:52:26 +0200 Subject: [PATCH] Update exit_reasons while migrating the database --- freqtrade/persistence/migrations.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/freqtrade/persistence/migrations.py b/freqtrade/persistence/migrations.py index 05958da69..9521eae69 100644 --- a/freqtrade/persistence/migrations.py +++ b/freqtrade/persistence/migrations.py @@ -153,7 +153,13 @@ def migrate_trades_and_orders_table( {initial_stop_loss} initial_stop_loss, {initial_stop_loss_pct} initial_stop_loss_pct, {stoploss_order_id} stoploss_order_id, {stoploss_last_update} stoploss_last_update, - {max_rate} max_rate, {min_rate} min_rate, {exit_reason} exit_reason, + {max_rate} max_rate, {min_rate} min_rate, + case when {exit_reason} == 'sell_signal' then 'exit_signal' + when {exit_reason} == 'custom_sell' then 'custom_exit' + when {exit_reason} == 'force_sell' then 'force_exit' + when {exit_reason} == 'emergency_sell' then 'emergency_exit' + else {exit_reason} + end exit_reason, {exit_order_status} exit_order_status, {strategy} strategy, {enter_tag} enter_tag, {timeframe} timeframe, {open_trade_value} open_trade_value, {close_profit_abs} close_profit_abs,