update sell_reason to exit_reason

This commit is contained in:
Matthias
2022-03-24 20:33:47 +01:00
parent b0fab3ad50
commit 543aa74278
28 changed files with 201 additions and 177 deletions

View File

@@ -555,7 +555,7 @@ class Backtesting:
current_time=sell_candle_time):
return None
trade.sell_reason = sell.exit_reason
trade.exit_reason = sell.exit_reason
# Checks and adds an exit tag, after checking that the length of the
# sell_row has the length for an exit tag column
@@ -564,7 +564,7 @@ class Backtesting:
and sell_row[EXIT_TAG_IDX] is not None
and len(sell_row[EXIT_TAG_IDX]) > 0
):
trade.sell_reason = sell_row[EXIT_TAG_IDX]
trade.exit_reason = sell_row[EXIT_TAG_IDX]
self.order_id_counter += 1
order = Order(
@@ -810,7 +810,7 @@ class Backtesting:
sell_row = data[pair][-1]
trade.close_date = sell_row[DATE_IDX].to_pydatetime()
trade.sell_reason = ExitType.FORCE_SELL.value
trade.exit_reason = ExitType.FORCE_SELL.value
trade.close(sell_row[OPEN_IDX], show_msg=False)
LocalTrade.close_bt_trade(trade)
# Deepcopy object to have wallets update correctly