Some subtle bugfixes
This commit is contained in:
parent
2abea58750
commit
822125d5f0
@ -1393,8 +1393,9 @@ class FreqtradeBot(LoggingMixin):
|
||||
# TODO: figure out how to handle partially complete sell orders
|
||||
reason = constants.CANCEL_REASON['PARTIALLY_FILLED_KEEP_OPEN']
|
||||
cancelled = False
|
||||
|
||||
order_obj = Order.parse_from_ccxt_object(order, trade.pair, 'sell')
|
||||
# TODO: This should probably fetch the correct order from database
|
||||
# instead of parsing it again
|
||||
order_obj = Order.parse_from_ccxt_object(order, trade.pair, trade.exit_side)
|
||||
sub_trade = order_obj.amount != trade.amount
|
||||
self._notify_exit_cancel(
|
||||
trade,
|
||||
@ -1547,13 +1548,9 @@ class FreqtradeBot(LoggingMixin):
|
||||
|
||||
# second condition is for mypy only; order will always be passed during sub trade
|
||||
if sub_trade and order is not None:
|
||||
amount = order.safe_filled
|
||||
amount = order.safe_filled if fill else order.amount
|
||||
profit_rate = order.safe_price
|
||||
|
||||
if not fill:
|
||||
# TODO: Need to get "prediction" here (without persisting)
|
||||
# trade.process_exit_sub_trade(order, is_closed=False)
|
||||
pass
|
||||
profit = trade.calc_profit(rate=profit_rate, amount=amount, open_rate=trade.open_rate)
|
||||
profit_ratio = trade.calc_profit_ratio(profit_rate, amount, trade.open_rate)
|
||||
else:
|
||||
|
@ -366,7 +366,8 @@ class Telegram(RPCHandler):
|
||||
elif msg_type in (RPCMessageType.ENTRY_CANCEL, RPCMessageType.EXIT_CANCEL):
|
||||
msg['message_side'] = 'enter' if msg_type in [RPCMessageType.ENTRY_CANCEL] else 'exit'
|
||||
message = (f"\N{WARNING SIGN} *{self._exchange_from_msg(msg)}:* "
|
||||
f"Cancelling {msg['message_side']} Order for {msg['pair']} "
|
||||
f"Cancelling {'partial ' if msg.get('sub_trade') else ''}"
|
||||
f"{msg['message_side']} Order for {msg['pair']} "
|
||||
f"(#{msg['trade_id']}). Reason: {msg['reason']}.")
|
||||
|
||||
elif msg_type == RPCMessageType.PROTECTION_TRIGGER:
|
||||
|
Loading…
Reference in New Issue
Block a user