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 Dec 19, 2023
1 parent d34d42e commit 0b2e067
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 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.661"
return "v14.0.662"

# ROI table:
minimal_roi = {
Expand Down Expand Up @@ -12021,6 +12021,22 @@ def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame
| (dataframe["close"] > dataframe["sup_level_1h"])
| (dataframe["close"] > dataframe["sup_level_4h"])
)
# 1h & qd downtrend, 5m & 15m & 1h downmove, 4h & 1d still high
& (
(dataframe["not_downtrend_1h"])
| (dataframe["not_downtrend_1d"])
| (dataframe["rsi_3"] > 16.0)
| (dataframe["rsi_3_15m"] > 12.0)
| (dataframe["rsi_3_1h"] > 20.0)
| (dataframe["rsi_14_4h"] < 36.0)
| (dataframe["rsi_14_4h"] < 40.0)
| (dataframe["rsi_14_1d"] < 40.0)
| (dataframe["close"] > dataframe["bb20_2_low_15m"])
| (dataframe["close"] > dataframe["bb20_2_low_1h"])
| (dataframe["close"] > dataframe["zlma_50_1h"])
| (dataframe["close"] > dataframe["sup_level_1h"])
| (dataframe["close"] > dataframe["sup_level_4h"])
)
)

# Global protections
Expand Down

0 comments on commit 0b2e067

Please sign in to comment.