commit
9fc7392817
@ -863,7 +863,6 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
exit_tag = None
|
exit_tag = None
|
||||||
exit_signal_type = "exit_short" if trade.is_short else "exit_long"
|
exit_signal_type = "exit_short" if trade.is_short else "exit_long"
|
||||||
|
|
||||||
# TODO-lev: change to use_exit_signal, ignore_roi_if_enter_signal
|
|
||||||
if (self.config.get('use_sell_signal', True) or
|
if (self.config.get('use_sell_signal', True) or
|
||||||
self.config.get('ignore_roi_if_buy_signal', False)):
|
self.config.get('ignore_roi_if_buy_signal', False)):
|
||||||
analyzed_df, _ = self.dataprovider.get_analyzed_dataframe(trade.pair,
|
analyzed_df, _ = self.dataprovider.get_analyzed_dataframe(trade.pair,
|
||||||
@ -946,7 +945,6 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
|
|
||||||
# We check if stoploss order is fulfilled
|
# We check if stoploss order is fulfilled
|
||||||
if stoploss_order and stoploss_order['status'] in ('closed', 'triggered'):
|
if stoploss_order and stoploss_order['status'] in ('closed', 'triggered'):
|
||||||
# TODO-lev: Update to exit reason
|
|
||||||
trade.sell_reason = SellType.STOPLOSS_ON_EXCHANGE.value
|
trade.sell_reason = SellType.STOPLOSS_ON_EXCHANGE.value
|
||||||
self.update_trade_state(trade, trade.stoploss_order_id, stoploss_order,
|
self.update_trade_state(trade, trade.stoploss_order_id, stoploss_order,
|
||||||
stoploss_order=True)
|
stoploss_order=True)
|
||||||
@ -1283,7 +1281,7 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
trade.amount,
|
trade.amount,
|
||||||
trade.open_date
|
trade.open_date
|
||||||
)
|
)
|
||||||
exit_type = 'sell' # TODO-lev: Update to exit
|
exit_type = 'sell'
|
||||||
if sell_reason.sell_type in (SellType.STOP_LOSS, SellType.TRAILING_STOP_LOSS):
|
if sell_reason.sell_type in (SellType.STOP_LOSS, SellType.TRAILING_STOP_LOSS):
|
||||||
exit_type = 'stoploss'
|
exit_type = 'stoploss'
|
||||||
|
|
||||||
@ -1319,12 +1317,12 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
order_type = self.strategy.order_types.get("emergencysell", "market")
|
order_type = self.strategy.order_types.get("emergencysell", "market")
|
||||||
|
|
||||||
amount = self._safe_exit_amount(trade.pair, trade.amount)
|
amount = self._safe_exit_amount(trade.pair, trade.amount)
|
||||||
time_in_force = self.strategy.order_time_in_force['sell'] # TODO-lev update to exit
|
time_in_force = self.strategy.order_time_in_force['sell']
|
||||||
|
|
||||||
if not strategy_safe_wrapper(self.strategy.confirm_trade_exit, default_retval=True)(
|
if not strategy_safe_wrapper(self.strategy.confirm_trade_exit, default_retval=True)(
|
||||||
pair=trade.pair, trade=trade, order_type=order_type, amount=amount, rate=limit,
|
pair=trade.pair, trade=trade, order_type=order_type, amount=amount, rate=limit,
|
||||||
time_in_force=time_in_force, sell_reason=sell_reason.sell_reason,
|
time_in_force=time_in_force, sell_reason=sell_reason.sell_reason,
|
||||||
current_time=datetime.now(timezone.utc)): # TODO-lev: Update to exit
|
current_time=datetime.now(timezone.utc)):
|
||||||
logger.info(f"User requested abortion of exiting {trade.pair}")
|
logger.info(f"User requested abortion of exiting {trade.pair}")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -74,7 +74,6 @@ def migrate_trades_table(decl_base, inspector, engine, table_back_name: str, col
|
|||||||
close_profit_abs = get_column_def(
|
close_profit_abs = get_column_def(
|
||||||
cols, 'close_profit_abs',
|
cols, 'close_profit_abs',
|
||||||
f"(amount * close_rate * (1 - {fee_close})) - {open_trade_value}")
|
f"(amount * close_rate * (1 - {fee_close})) - {open_trade_value}")
|
||||||
# TODO-lev: update to exit order status
|
|
||||||
sell_order_status = get_column_def(cols, 'sell_order_status', 'null')
|
sell_order_status = get_column_def(cols, 'sell_order_status', 'null')
|
||||||
amount_requested = get_column_def(cols, 'amount_requested', 'amount')
|
amount_requested = get_column_def(cols, 'amount_requested', 'amount')
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ def short_trade(fee):
|
|||||||
open_order_id='dry_run_exit_short_12345',
|
open_order_id='dry_run_exit_short_12345',
|
||||||
strategy='DefaultStrategy',
|
strategy='DefaultStrategy',
|
||||||
timeframe=5,
|
timeframe=5,
|
||||||
sell_reason='sell_signal', # TODO-lev: Update to exit/close reason
|
sell_reason='sell_signal',
|
||||||
open_date=datetime.now(tz=timezone.utc) - timedelta(minutes=20),
|
open_date=datetime.now(tz=timezone.utc) - timedelta(minutes=20),
|
||||||
# close_date=datetime.now(tz=timezone.utc) - timedelta(minutes=2),
|
# close_date=datetime.now(tz=timezone.utc) - timedelta(minutes=2),
|
||||||
is_short=True
|
is_short=True
|
||||||
|
Loading…
Reference in New Issue
Block a user