fixed side error
This commit is contained in:
parent
7059892304
commit
fd211166f0
@ -392,8 +392,8 @@ class Backtesting:
|
|||||||
):
|
):
|
||||||
# Worst case: price reaches stop_positive_offset and dives down.
|
# Worst case: price reaches stop_positive_offset and dives down.
|
||||||
stop_rate = (sell_row[OPEN_IDX] *
|
stop_rate = (sell_row[OPEN_IDX] *
|
||||||
(1 + side_1 * abs(self.strategy.trailing_stop_positive_offset) +
|
(1 + side_1 * abs(self.strategy.trailing_stop_positive_offset) -
|
||||||
abs(self.strategy.trailing_stop_positive / leverage)))
|
side_1 * abs(self.strategy.trailing_stop_positive / leverage)))
|
||||||
else:
|
else:
|
||||||
# Worst case: price ticks tiny bit above open and dives down.
|
# Worst case: price ticks tiny bit above open and dives down.
|
||||||
stop_rate = sell_row[OPEN_IDX] * (1 -
|
stop_rate = sell_row[OPEN_IDX] * (1 -
|
||||||
|
Loading…
Reference in New Issue
Block a user