Skip to content

Commit

Permalink
X5: add global protection rule (Long).
Browse files Browse the repository at this point in the history
  • Loading branch information
iterativv committed Jan 28, 2025
1 parent a59cab5 commit ab80fc2
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion NostalgiaForInfinityX5.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class NostalgiaForInfinityX5(IStrategy):
INTERFACE_VERSION = 3

def version(self) -> str:
return "v15.1.353"
return "v15.1.354"

stoploss = -0.99

Expand Down Expand Up @@ -5841,6 +5841,28 @@ def populate_indicators(self, df: DataFrame, metadata: dict) -> DataFrame:
| (df["STOCHk_14_3_3_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 5m & 15m & 1h & 4h & 1d down move, 15m & 1h & 4h still not low enough, 1d still not low enough & downtrend
& (
(df["RSI_3"] > 5.0)
| (df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_3_1d"] > 50.0)
| (df["RSI_14_15m"] < 10.0)
| (df["CMF_20_15m"] > -0.25)
| (df["MFI_14_15m"] < 10.0)
| (df["CCI_20_15m"] < -450.0)
| (df["RSI_14_1h"] < 25.0)
| (df["MFI_14_1h"] < 40.0)
| (df["AROONU_14_1h"] < 25.0)
| (df["CCI_20_1h"] < -250.0)
| (df["RSI_14_4h"] < 30.0)
| (df["MFI_14_4h"] < 40.0)
| (df["AROONU_14_4h"] < 25.0)
| (df["CCI_20_4h"] < -200.0)
| (df["RSI_14_1d"] < 30.0)
| (df["ROC_9_1d"] > -10.0)
)
# 5m & 15m & 1h & 4h & 1d down move, 15m & 1h & 4h still not low enough. 1 still not low enough & downtrend
& (
(df["RSI_3"] > 10.0)
Expand Down Expand Up @@ -7367,6 +7389,24 @@ def populate_indicators(self, df: DataFrame, metadata: dict) -> DataFrame:
| (df["AROONU_14_1d"] < 25.0)
| (df["STOCHk_14_3_3_1d"] < 10.0)
)
# 15m & 1h & 1d down move, 15m & 1h & 4h still not low enough, 1d still not low enough & downtrend
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_1d"] > 20.0)
| (df["RSI_14_15m"] < 20.0)
| (df["CMF_20_15m"] > -0.15)
| (df["CCI_20_15m"] < -350.0)
| (df["RSI_14_1h"] < 25.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["CCI_20_1h"] < -250.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
| (df["RSI_14_4h"] < 35.0)
| (df["CCI_20_4h"] < -100.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["RSI_14_1d"] < 35.0)
| (df["ROC_9_1d"] > -20.0)
)
# 15m & 1h & 1d down move, 15m & 1h still not low enough, 4h still high, 1d still not low enough & downtrend
& (
(df["RSI_3_15m"] > 25.0)
Expand Down

0 comments on commit ab80fc2

Please sign in to comment.