Skip to content

Commit

Permalink
X5: doom stops: don't exit if there is a valid entry signal on the ca…
Browse files Browse the repository at this point in the history
…ndle.
  • Loading branch information
iterativv committed Nov 27, 2024
1 parent fe91329 commit 8a29df1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions NostalgiaForInfinityX5.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class NostalgiaForInfinityX5(IStrategy):
INTERFACE_VERSION = 3

def version(self) -> str:
return "v15.1.244"
return "v15.1.245"

stoploss = -0.99

Expand Down Expand Up @@ -24264,7 +24264,7 @@ def long_exit_stoploss(
current_time: "datetime",
buy_tag,
) -> tuple:
is_backtest = self.dp.runmode.value in ["backtest", "hyperopt"]
is_backtest = self.is_backtest_mode
# Stoploss doom
if (
profit_stake
Expand All @@ -24273,6 +24273,7 @@ def long_exit_stoploss(
* (self.stop_threshold_doom_futures if self.is_futures_mode else self.stop_threshold_doom_spot)
/ trade.leverage
)
and not self.has_valid_entry_conditions(last_candle, "long")
# temporary
and (trade.open_date_utc.replace(tzinfo=None) >= datetime(2024, 9, 13) or is_backtest)
):
Expand Down Expand Up @@ -41303,7 +41304,7 @@ def short_exit_stoploss(
current_time: "datetime",
buy_tag,
) -> tuple:
is_backtest = self.dp.runmode.value in ["backtest", "hyperopt"]
is_backtest = self.is_backtest_mode
# Stoploss doom
if (
profit_stake
Expand All @@ -41312,6 +41313,7 @@ def short_exit_stoploss(
* (self.stop_threshold_doom_futures if self.is_futures_mode else self.stop_threshold_doom_spot)
/ trade.leverage
)
and not self.has_valid_entry_conditions(last_candle, "short")
# temporary
and (trade.open_date_utc.replace(tzinfo=None) >= datetime(2024, 9, 13) or is_backtest)
):
Expand Down

0 comments on commit 8a29df1

Please sign in to comment.