Skip to content

Commit

Permalink
X4: add global buy protection rule.
Browse files Browse the repository at this point in the history
  • Loading branch information
iterativv committed Nov 29, 2023
1 parent 636ab20 commit 08a429f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion NostalgiaForInfinityX4.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class NostalgiaForInfinityX4(IStrategy):
INTERFACE_VERSION = 3

def version(self) -> str:
return "v14.0.530"
return "v14.0.531"

# ROI table:
minimal_roi = {
Expand Down Expand Up @@ -9969,6 +9969,19 @@ def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame
| (dataframe["close"] > dataframe["sup_level_1h"])
| (dataframe["close"] > dataframe["sup_level_4h"])
)
# 1h & 4h & 1d downtrend, 1h & 1d downmove, 5m & 15m still high, 5h low, 1h & 4h downtrend
& (
(dataframe["not_downtrend_1h"])
| (dataframe["not_downtrend_4h"])
| (dataframe["not_downtrend_1d"])
| (dataframe["rsi_3_1h"] > 30.0)
| (dataframe["rsi_3_1d"] > 30.0)
| (dataframe["rsi_14"] < 30.0)
| (dataframe["rsi_14_15m"] < 30.0)
| (dataframe["r_480_4h"] > -75.0)
| (dataframe["ema_200_dec_48_1h"] == False)
| (dataframe["ema_200_dec_24_4h"] == False)
)
)

# Global protections
Expand Down

0 comments on commit 08a429f

Please sign in to comment.