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 30, 2023
1 parent 5f69629 commit 962e7f0
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.536"
return "v14.0.537"

# ROI table:
minimal_roi = {
Expand Down Expand Up @@ -10020,6 +10020,19 @@ def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame
| (dataframe["rsi_14_1d"] < 50.0)
| (dataframe["r_480_4h"] < -20.0)
)
# current 4h red, previous 4h green, 15m & 1h downtrend, 15m & 1h downmove, 4h high, 1h downtrend
& (
(dataframe["change_pct_4h"] > -0.02)
| (dataframe["change_pct_4h"].shift(48) < 0.04)
| (dataframe["not_downtrend_15m"])
| (dataframe["not_downtrend_1h"])
| (dataframe["rsi_3_15m"] > 26.0)
| (dataframe["rsi_3_1h"] > 12.0)
| (dataframe["rsi_14_4h"] < 50.0)
| (dataframe["close"] > dataframe["sup_level_1h"])
| (dataframe["close"] > dataframe["sup_level_4h"])
| (dataframe["ema_200_dec_48_1h"] == False)
)
)

# Global protections
Expand Down

0 comments on commit 962e7f0

Please sign in to comment.