Fix short bug where close_rate is wrongly adjusted
This commit is contained in:
parent
c934f939e3
commit
d6309449cf
@ -542,6 +542,9 @@ class Backtesting:
|
|||||||
proposed_rate=closerate, current_profit=current_profit)
|
proposed_rate=closerate, current_profit=current_profit)
|
||||||
# We can't place orders lower than current low.
|
# We can't place orders lower than current low.
|
||||||
# freqtrade does not support this in live, and the order would fill immediately
|
# freqtrade does not support this in live, and the order would fill immediately
|
||||||
|
if trade.is_short:
|
||||||
|
closerate = min(closerate, sell_row[HIGH_IDX])
|
||||||
|
else:
|
||||||
closerate = max(closerate, sell_row[LOW_IDX])
|
closerate = max(closerate, sell_row[LOW_IDX])
|
||||||
# Confirm trade exit:
|
# Confirm trade exit:
|
||||||
time_in_force = self.strategy.order_time_in_force['exit']
|
time_in_force = self.strategy.order_time_in_force['exit']
|
||||||
|
Loading…
Reference in New Issue
Block a user