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 Oct 8, 2023
1 parent 8bda3d5 commit 58d61a0
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion NostalgiaForInfinityX4.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class NostalgiaForInfinityX4(IStrategy):
INTERFACE_VERSION = 3

def version(self) -> str:
return "v14.0.295"
return "v14.0.296"

# ROI table:
minimal_roi = {
Expand Down Expand Up @@ -6061,6 +6061,41 @@ def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame
| (dataframe['rsi_14_1d'] < 60.0)
| (dataframe['high_max_12_1d'] < (dataframe['close'] * 0.9))
)
# 1h downtrend, 5m downmove, 1h & 4h low, 1h & 4h & 1d downtrend
&
(
(dataframe['not_downtrend_1h'])
| (dataframe['rsi_3'] > 10.0)
| (dataframe['r_480_1h'] > -70.0)
| (dataframe['r_480_4h'] > -85.0)
| (dataframe['ema_200_dec_48_1h'] == False)
| (dataframe['ema_200_dec_24_4h'] == False)
| (dataframe['ema_200_dec_4_1d'] == False)
)
# 1h downtrend, 5m & 15m & 1h & 4h downmove, 4h very low, 4h & 1d downtrend
&
(
(dataframe['not_downtrend_1h'])
| (dataframe['rsi_3'] > 16.0)
| (dataframe['rsi_3_15m'] > 26.0)
| (dataframe['rsi_3_1h'] > 36.0)
| (dataframe['rsi_3_4h'] > 36.0)
| (dataframe['r_480_4h'] > -95.0)
| (dataframe['ema_200_dec_24_4h'] == False)
| (dataframe['ema_200_dec_4_1d'] == False)
)
# 1h downtrend, 5m & 1h downmove, 15m still high, 1h & 4h low, 4h & 1d downtrend
&
(
(dataframe['not_downtrend_1h'])
| (dataframe['rsi_3'] > 10.0)
| (dataframe['rsi_3_1h'] > 36.0)
| (dataframe['rsi_14_15m'] < 40.0)
| (dataframe['r_480_1h'] > -75.0)
| (dataframe['r_480_4h'] > -90.0)
| (dataframe['ema_200_dec_24_4h'] == False)
| (dataframe['ema_200_dec_4_1d'] == False)
)
)

tok = time.perf_counter()
Expand Down

0 comments on commit 58d61a0

Please sign in to comment.