Skip to content

Commit

Permalink
X6: futures: doom stops scale with leverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
iterativv committed Mar 10, 2025
1 parent 61400e2 commit a37e2f6
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions NostalgiaForInfinityX6.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class NostalgiaForInfinityX6(IStrategy):
INTERFACE_VERSION = 3

def version(self) -> str:
return "v16.2.2"
return "v16.2.3"

stoploss = -0.99

Expand Down Expand Up @@ -181,13 +181,13 @@ def version(self) -> str:
stop_threshold_spot = 0.10
stop_threshold_futures = 0.10
stop_threshold_doom_spot = 0.12
stop_threshold_doom_futures = 0.36
stop_threshold_doom_futures = 0.12
stop_threshold_spot_rebuy = 1.0
stop_threshold_futures_rebuy = 3.0
stop_threshold_rapid_spot = 0.12
stop_threshold_rapid_futures = 0.36
stop_threshold_rapid_futures = 0.12
stop_threshold_derisk_spot = 0.12
stop_threshold_derisk_futures = 0.36
stop_threshold_derisk_futures = 0.12

# user specified fees to be used for profit calculations
custom_fee_open_rate = None
Expand Down Expand Up @@ -836,18 +836,12 @@ def exit_profit_target(
if trade.open_date_utc.replace(tzinfo=None) >= datetime(2025, 3, 9) or is_backtest:
if not is_rapid_mode and (
profit_init_ratio
<= -(
(self.stop_threshold_doom_futures if self.is_futures_mode else self.stop_threshold_doom_spot)
/ trade.leverage
)
<= -(self.stop_threshold_doom_futures if self.is_futures_mode else self.stop_threshold_doom_spot)
):
return True, previous_sell_reason
elif is_rapid_mode and (
profit_init_ratio
<= -(
(self.stop_threshold_rapid_futures if self.is_futures_mode else self.stop_threshold_rapid_spot)
/ trade.leverage
)
<= -(self.stop_threshold_rapid_futures if self.is_futures_mode else self.stop_threshold_rapid_spot)
):
return True, previous_sell_reason
if profit_init_ratio > 0.0:
Expand Down Expand Up @@ -17247,7 +17241,6 @@ def long_exit_rapid(
< -(
filled_entries[0].cost
* (self.stop_threshold_rapid_futures if self.is_futures_mode else self.stop_threshold_rapid_spot)
/ trade.leverage
)
)
)
Expand Down Expand Up @@ -31726,7 +31719,6 @@ def long_exit_stoploss(
< -(
filled_entries[0].cost
* (self.stop_threshold_doom_futures if self.is_futures_mode else self.stop_threshold_doom_spot)
/ trade.leverage
)
)
and (self.has_valid_entry_conditions(trade, current_rate, last_candle, previous_candle_1) == False)
Expand Down Expand Up @@ -37916,7 +37908,6 @@ def short_exit_rapid(
< -(
filled_entries[0].cost
* (self.stop_threshold_rapid_futures if self.is_futures_mode else self.stop_threshold_rapid_spot)
/ trade.leverage
)
)
)
Expand Down Expand Up @@ -52395,7 +52386,6 @@ def short_exit_stoploss(
< -(
filled_entries[0].cost
* (self.stop_threshold_doom_futures if self.is_futures_mode else self.stop_threshold_doom_spot)
/ trade.leverage
)
)
and (self.has_valid_entry_conditions(trade, current_rate, last_candle, previous_candle_1) == False)
Expand Down

0 comments on commit a37e2f6

Please sign in to comment.