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 28, 2023
1 parent b35286f commit 45a435e
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 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.521"
return "v14.0.522"

# ROI table:
minimal_roi = {
Expand Down Expand Up @@ -9842,6 +9842,30 @@ def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame
| (dataframe["ema_200_dec_48_1h"] == False)
| (dataframe["close"] > (dataframe["high_max_6_1d"] * 0.6))
)
# current 4h red, 1h downtrend, 1h dowmove, 1h & 4h & 1d still high
& (
(dataframe["change_pct_4h"] > -0.04)
| (dataframe["not_downtrend_1h"])
| (dataframe["rsi_3_1h"] > 20.0)
| (dataframe["cti_20_1h"] < 0.5)
| (dataframe["rsi_14_1h"] < 40.0)
| (dataframe["cti_20_4h"] < 0.5)
| (dataframe["rsi_14_4h"] < 46.0)
| (dataframe["cti_20_1d"] < -0.5)
| (dataframe["rsi_14_1d"] < 46.0)
)
# current 4h green with top wick, 1h downmove, 15m & 1h & 4h & 1d still high
& (
(dataframe["change_pct_4h"] < 0.02)
| (dataframe["top_wick_pct_4h"] < 0.08)
| (dataframe["rsi_3_1h"] > 26.0)
| (dataframe["rsi_14_15m"] < 30.0)
| (dataframe["cti_20_1h"] < 0.5)
| (dataframe["rsi_14_1h"] < 46.0)
| (dataframe["rsi_14_4h"] < 70.0)
| (dataframe["cti_20_1d"] < -0.5)
| (dataframe["rsi_14_1d"] < 46.0)
)
)

# Global protections
Expand Down

0 comments on commit 45a435e

Please sign in to comment.