Small fixes to align backtesting with live
This commit is contained in:
parent
0bfb0febe9
commit
76907cb4d6
@ -539,7 +539,8 @@ class FreqtradeBot(LoggingMixin):
|
||||
logger.debug(f"Calling adjust_trade_position for pair {trade.pair}")
|
||||
stake_amount = strategy_safe_wrapper(self.strategy.adjust_trade_position,
|
||||
default_retval=None)(
|
||||
trade=trade, current_time=datetime.now(timezone.utc), current_rate=current_entry_rate,
|
||||
trade=trade,
|
||||
current_time=datetime.now(timezone.utc), current_rate=current_entry_rate,
|
||||
current_profit=current_entry_profit, min_stake=min_entry_stake,
|
||||
max_stake=min(max_entry_stake, stake_available),
|
||||
current_entry_rate=current_entry_rate, current_exit_rate=current_exit_rate,
|
||||
|
@ -522,8 +522,8 @@ class Backtesting:
|
||||
if stake_amount is not None and stake_amount < 0.0:
|
||||
amount = abs(stake_amount) / current_rate
|
||||
if amount > trade.amount:
|
||||
# selling more than available is not supported.
|
||||
return trade
|
||||
# This is currently ineffective as remaining would become < min tradable
|
||||
amount = trade.amount
|
||||
remaining = (trade.amount - amount) * current_rate
|
||||
if remaining < min_stake:
|
||||
# Remaining stake is too low to be sold.
|
||||
|
Loading…
Reference in New Issue
Block a user