is_short for forceentries
This commit is contained in:
parent
f0f5a50975
commit
536f54cfc6
@ -769,8 +769,10 @@ class RPC:
|
|||||||
# check if valid pair
|
# check if valid pair
|
||||||
|
|
||||||
# check if pair already has an open pair
|
# check if pair already has an open pair
|
||||||
trade = Trade.get_trades([Trade.is_open.is_(True), Trade.pair == pair]).first()
|
trade: Trade = Trade.get_trades([Trade.is_open.is_(True), Trade.pair == pair]).first()
|
||||||
|
is_short = (order_side == SignalDirection.SHORT)
|
||||||
if trade:
|
if trade:
|
||||||
|
is_short = trade.is_short
|
||||||
if not self._freqtrade.strategy.position_adjustment_enable:
|
if not self._freqtrade.strategy.position_adjustment_enable:
|
||||||
raise RPCException(f'position for {pair} already open - id: {trade.id}')
|
raise RPCException(f'position for {pair} already open - id: {trade.id}')
|
||||||
|
|
||||||
@ -784,7 +786,7 @@ class RPC:
|
|||||||
'forcebuy', self._freqtrade.strategy.order_types['buy'])
|
'forcebuy', self._freqtrade.strategy.order_types['buy'])
|
||||||
if self._freqtrade.execute_entry(pair, stake_amount, price,
|
if self._freqtrade.execute_entry(pair, stake_amount, price,
|
||||||
ordertype=order_type, trade=trade,
|
ordertype=order_type, trade=trade,
|
||||||
is_short=(order_side == SignalDirection.SHORT),
|
is_short=is_short,
|
||||||
enter_tag=enter_tag,
|
enter_tag=enter_tag,
|
||||||
):
|
):
|
||||||
Trade.commit()
|
Trade.commit()
|
||||||
|
Loading…
Reference in New Issue
Block a user