Skip to content

Commit

Permalink
Support selling via emergencysell
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Sep 1, 2019
1 parent 9f53e9f commit 292df11
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion freqtrade/freqtradebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,9 +881,14 @@ def execute_sell(self, trade: Trade, limit: float, sell_reason: SellType) -> Non
except InvalidOrderException:
logger.exception(f"Could not cancel stoploss order {trade.stoploss_order_id}")

ordertype = self.strategy.order_types[sell_type]
if sell_reason == SellType.EMERGENCY_SELL:
# Emergencysells (default to market!)
ordertype = self.strategy.order_types.get("emergencysell", "market")

# Execute sell and update trade record
order = self.exchange.sell(pair=str(trade.pair),
ordertype=self.strategy.order_types[sell_type],
ordertype=ordertype,
amount=trade.amount, rate=limit,
time_in_force=self.strategy.order_time_in_force['sell']
)
Expand Down

0 comments on commit 292df11

Please sign in to comment.