freqtradebot.leverage_prep moved wallet_balance to a variable
This commit is contained in:
parent
8b9abd0051
commit
430051275a
@ -618,12 +618,13 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
self.collateral_type == Collateral.ISOLATED and
|
self.collateral_type == Collateral.ISOLATED and
|
||||||
self.trading_mode == TradingMode.FUTURES
|
self.trading_mode == TradingMode.FUTURES
|
||||||
):
|
):
|
||||||
|
wallet_balance = (amount * open_rate)/leverage
|
||||||
isolated_liq = self.exchange.get_liquidation_price(
|
isolated_liq = self.exchange.get_liquidation_price(
|
||||||
pair=pair,
|
pair=pair,
|
||||||
open_rate=open_rate,
|
open_rate=open_rate,
|
||||||
is_short=is_short,
|
is_short=is_short,
|
||||||
position=amount,
|
position=amount,
|
||||||
wallet_balance=(amount * open_rate)/leverage, # TODO: Update for cross
|
wallet_balance=wallet_balance,
|
||||||
mm_ex_1=0.0,
|
mm_ex_1=0.0,
|
||||||
upnl_ex_1=0.0,
|
upnl_ex_1=0.0,
|
||||||
)
|
)
|
||||||
@ -1176,8 +1177,8 @@ class FreqtradeBot(LoggingMixin):
|
|||||||
max_timeouts = self.config.get('unfilledtimeout', {}).get('exit_timeout_count', 0)
|
max_timeouts = self.config.get('unfilledtimeout', {}).get('exit_timeout_count', 0)
|
||||||
|
|
||||||
if not_closed and (fully_cancelled or self.strategy.ft_check_timed_out(
|
if not_closed and (fully_cancelled or self.strategy.ft_check_timed_out(
|
||||||
time_method, trade, order, datetime.now(timezone.utc))
|
time_method, trade, order, datetime.now(timezone.utc))
|
||||||
):
|
):
|
||||||
if is_entering:
|
if is_entering:
|
||||||
self.handle_cancel_enter(trade, order, constants.CANCEL_REASON['TIMEOUT'])
|
self.handle_cancel_enter(trade, order, constants.CANCEL_REASON['TIMEOUT'])
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user