Merge pull request #6512 from freqtrade/short_order_types

Short order types renamal
This commit is contained in:
Matthias
2022-03-12 09:32:16 +01:00
committed by GitHub
33 changed files with 198 additions and 131 deletions

View File

@@ -138,11 +138,11 @@ class UnfilledTimeout(BaseModel):
class OrderTypes(BaseModel):
buy: OrderTypeValues
sell: OrderTypeValues
emergencysell: Optional[OrderTypeValues]
forcesell: Optional[OrderTypeValues]
forcebuy: Optional[OrderTypeValues]
entry: OrderTypeValues
exit: OrderTypeValues
emergencyexit: Optional[OrderTypeValues]
forceexit: Optional[OrderTypeValues]
forceentry: Optional[OrderTypeValues]
stoploss: OrderTypeValues
stoploss_on_exchange: bool
stoploss_on_exchange_interval: Optional[int]

View File

@@ -712,7 +712,7 @@ class RPC:
trade.pair, refresh=False, side=trade.exit_side)
sell_reason = SellCheckTuple(sell_type=SellType.FORCE_SELL)
order_type = ordertype or self._freqtrade.strategy.order_types.get(
"forcesell", self._freqtrade.strategy.order_types["sell"])
"forceexit", self._freqtrade.strategy.order_types["exit"])
self._freqtrade.execute_trade_exit(
trade, current_rate, sell_reason, ordertype=order_type)
@@ -735,7 +735,7 @@ class RPC:
trade_filter=[Trade.id == trade_id, Trade.is_open.is_(True), ]
).first()
if not trade:
logger.warning('forcesell: Invalid argument received')
logger.warning('forceexit: Invalid argument received')
raise RPCException('invalid argument')
_exec_forcesell(trade)
@@ -784,7 +784,7 @@ class RPC:
# execute buy
if not order_type:
order_type = self._freqtrade.strategy.order_types.get(
'forcebuy', self._freqtrade.strategy.order_types['buy'])
'forceentry', self._freqtrade.strategy.order_types['entry'])
if self._freqtrade.execute_entry(pair, stake_amount, price,
ordertype=order_type, trade=trade,
is_short=is_short,

View File

@@ -944,7 +944,7 @@ class Telegram(RPCHandler):
return
try:
msg = self._rpc._rpc_forceexit(trade_id)
self._send_msg('Forcesell Result: `{result}`'.format(**msg))
self._send_msg('Forceexit Result: `{result}`'.format(**msg))
except RPCException as e:
self._send_msg(str(e))