Skip to content

Commit 2255f48

Browse files
committed
Buy 59: Semi swing. Local dip.
1 parent e16b3d1 commit 2255f48

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

NostalgiaForInfinityX.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ class NostalgiaForInfinityX(IStrategy):
239239
"buy_condition_56_enable": True,
240240
"buy_condition_57_enable": True,
241241
"buy_condition_58_enable": True,
242+
"buy_condition_59_enable": True,
242243
#############
243244
}
244245

@@ -1874,6 +1875,34 @@ class NostalgiaForInfinityX(IStrategy):
18741875
"close_over_pivot_offset" : 1.0,
18751876
"close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
18761877
"close_under_pivot_offset" : 1.0
1878+
},
1879+
59: {
1880+
"ema_fast" : False,
1881+
"ema_fast_len" : "50",
1882+
"ema_slow" : False,
1883+
"ema_slow_len" : "50",
1884+
"close_above_ema_fast" : False,
1885+
"close_above_ema_fast_len" : "200",
1886+
"close_above_ema_slow" : False,
1887+
"close_above_ema_slow_len" : "200",
1888+
"sma200_rising" : False,
1889+
"sma200_rising_val" : "42",
1890+
"sma200_1h_rising" : False,
1891+
"sma200_1h_rising_val" : "50",
1892+
"safe_dips_threshold_0" : 0.032,
1893+
"safe_dips_threshold_2" : 0.09,
1894+
"safe_dips_threshold_12" : None,
1895+
"safe_dips_threshold_144" : None,
1896+
"safe_pump_6h_threshold" : 0.5,
1897+
"safe_pump_12h_threshold" : None,
1898+
"safe_pump_24h_threshold" : None,
1899+
"safe_pump_36h_threshold" : None,
1900+
"safe_pump_48h_threshold" : 1.0,
1901+
"btc_1h_not_downtrend" : False,
1902+
"close_over_pivot_type" : "sup3", # pivot, sup1, sup2, sup3, res1, res2, res3
1903+
"close_over_pivot_offset" : 0.75,
1904+
"close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
1905+
"close_under_pivot_offset" : 1.0
18771906
}
18781907
}
18791908

@@ -6720,6 +6749,8 @@ def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFram
67206749
dataframe['vma_10'] = ta.SMA(dataframe['volume'], timeperiod=10)
67216750
dataframe['vma_20'] = ta.SMA(dataframe['volume'], timeperiod=20)
67226751
dataframe['vol_osc'] = (dataframe['vma_10'] - dataframe['vma_20']) / dataframe['vma_20'] * 100
6752+
dataframe['volume_mean_12'] = dataframe['volume'].rolling(12).mean().shift(1)
6753+
dataframe['volume_mean_24'] = dataframe['volume'].rolling(24).mean().shift(1)
67236754

67246755
# Dip protection
67256756
dataframe['tpct_change_0'] = self.top_percent_change(dataframe,0)
@@ -7643,6 +7674,18 @@ def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
76437674
item_buy_logic.append(dataframe['close_delta'] > dataframe['close'] * 10.0 / 1000.0 )
76447675
item_buy_logic.append(dataframe['close'] < (dataframe['bb20_3_low'] * 0.996))
76457676

7677+
# Condition #59 - Semi swing. Local dip.
7678+
elif index == 59:
7679+
# Non-Standard protections
7680+
7681+
# Logic
7682+
item_buy_logic.append(dataframe['ema_100'] < (dataframe['ema_200'] * 1.054))
7683+
item_buy_logic.append(dataframe['bb20_width'] > 0.34)
7684+
item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_mid'] * 1.014))
7685+
item_buy_logic.append(dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.6))
7686+
item_buy_logic.append(dataframe['cti'] < -0.115)
7687+
item_buy_logic.append(dataframe['r_14'] < -45.0)
7688+
76467689
item_buy_logic.append(dataframe['volume'] > 0)
76477690
item_buy = reduce(lambda x, y: x & y, item_buy_logic)
76487691
dataframe.loc[item_buy, 'buy_tag'] += f"{index} "

0 commit comments

Comments
 (0)