@@ -107,7 +107,7 @@ class NostalgiaForInfinityX(IStrategy):
107107 INTERFACE_VERSION = 2
108108
109109 def version(self) -> str:
110- return "v10.7.63 "
110+ return "v10.8.0 "
111111
112112 # ROI table:
113113 minimal_roi = {
@@ -246,6 +246,7 @@ def version(self) -> str:
246246 "buy_condition_59_enable": True,
247247 "buy_condition_60_enable": True,
248248 "buy_condition_61_enable": True,
249+ "buy_condition_62_enable": True,
249250 #############
250251 }
251252
@@ -1937,6 +1938,34 @@ def version(self) -> str:
19371938 "close_over_pivot_offset" : 0.96,
19381939 "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
19391940 "close_under_pivot_offset" : 1.0
1941+ },
1942+ 62: {
1943+ "ema_fast" : False,
1944+ "ema_fast_len" : "50",
1945+ "ema_slow" : False,
1946+ "ema_slow_len" : "50",
1947+ "close_above_ema_fast" : False,
1948+ "close_above_ema_fast_len" : "200",
1949+ "close_above_ema_slow" : False,
1950+ "close_above_ema_slow_len" : "200",
1951+ "sma200_rising" : False,
1952+ "sma200_rising_val" : "42",
1953+ "sma200_1h_rising" : False,
1954+ "sma200_1h_rising_val" : "50",
1955+ "safe_dips_threshold_0" : 0.032,
1956+ "safe_dips_threshold_2" : 0.09,
1957+ "safe_dips_threshold_12" : 0.18,
1958+ "safe_dips_threshold_144" : 0.23,
1959+ "safe_pump_6h_threshold" : 0.5,
1960+ "safe_pump_12h_threshold" : None,
1961+ "safe_pump_24h_threshold" : None,
1962+ "safe_pump_36h_threshold" : None,
1963+ "safe_pump_48h_threshold" : 1.4,
1964+ "btc_1h_not_downtrend" : False,
1965+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
1966+ "close_over_pivot_offset" : 1.0,
1967+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
1968+ "close_under_pivot_offset" : 1.0
19401969 }
19411970 }
19421971
@@ -7270,6 +7299,9 @@ def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> Dat
72707299 # ROC
72717300 informative_1h['roc_9'] = ta.ROC(informative_1h, timeperiod=9)
72727301
7302+ # T3 Average
7303+ informative_1h['t3_avg'] = t3_average(informative_1h)
7304+
72737305 # S/R
72747306 res_series = informative_1h['high'].rolling(window = 5, center=True).apply(lambda row: self.is_resistance(row), raw=True).shift(2)
72757307 sup_series = informative_1h['low'].rolling(window = 5, center=True).apply(lambda row: self.is_support(row), raw=True).shift(2)
@@ -7458,6 +7490,9 @@ def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFram
74587490 # Close delta
74597491 dataframe['close_delta'] = (dataframe['close'] - dataframe['close'].shift(1)).abs()
74607492
7493+ # T3 Average
7494+ dataframe['t3_avg'] = t3_average(dataframe)
7495+
74617496 # ATR
74627497 dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)
74637498 dataframe['atr_high_thresh_1'] = (dataframe['high'] - (dataframe['atr'] * 5.4))
@@ -8427,9 +8462,11 @@ def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
84278462 item_buy_logic.append(dataframe['close'] < dataframe['ema_16'] * 0.968)
84288463 item_buy_logic.append(dataframe['rsi_14'] < 22.0)
84298464
8430- # Condition #61 - Semi swing. Local dip. Stochastic fast cross.
8465+ # Condition #61 - Semi swing. Local dip. Stochastic fast cross.
84318466 elif index == 61:
84328467 # Non-Standard protections
8468+
8469+ # Logic
84338470 item_buy_logic.append(dataframe['open'] < dataframe['ema_8'] * 1.147)
84348471 item_buy_logic.append(qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd']))
84358472 item_buy_logic.append(dataframe['fastk'] < 39.0)
@@ -8440,6 +8477,18 @@ def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
84408477 item_buy_logic.append(dataframe['cti_1h'] < 0.0)
84418478 item_buy_logic.append(dataframe['r_480_1h'] < -25.0)
84428479
8480+ # Condition #62 - Semi swing. Local dip. Downtrend.
8481+ elif index == 62:
8482+ # Non-Standard protections
8483+
8484+ # Logic
8485+ item_buy_logic.append(dataframe['ewo'] < -8.1)
8486+
8487+ item_buy_logic.append(dataframe['bb20_2_mid_1h'] >= dataframe['t3_avg_1h'])
8488+ item_buy_logic.append(dataframe['t3_avg'] <= dataframe['ema_8'] * 1.121)
8489+ item_buy_logic.append(dataframe['cti'] < -0.9)
8490+ item_buy_logic.append(dataframe['r_14'] < -75.0)
8491+
84438492 item_buy_logic.append(dataframe['volume'] > 0)
84448493 item_buy = reduce(lambda x, y: x & y, item_buy_logic)
84458494 dataframe.loc[item_buy, 'buy_tag'] += f"{index} "
@@ -8638,6 +8687,34 @@ def ema_vwma_osc(dataframe, len_slow_ma):
86388687 slow_ema = Series(ta.EMA(vwma(dataframe, len_slow_ma), len_slow_ma))
86398688 return ((slow_ema - slow_ema.shift(1)) / slow_ema.shift(1)) * 100
86408689
8690+ def t3_average(dataframe, length=5):
8691+ """
8692+ T3 Average by HPotter on Tradingview
8693+ https://www.tradingview.com/script/qzoC9H1I-T3-Average/
8694+ """
8695+ df = dataframe.copy()
8696+
8697+ df['xe1'] = ta.EMA(df['close'], timeperiod=length)
8698+ df['xe1'].fillna(0, inplace=True)
8699+ df['xe2'] = ta.EMA(df['xe1'], timeperiod=length)
8700+ df['xe2'].fillna(0, inplace=True)
8701+ df['xe3'] = ta.EMA(df['xe2'], timeperiod=length)
8702+ df['xe3'].fillna(0, inplace=True)
8703+ df['xe4'] = ta.EMA(df['xe3'], timeperiod=length)
8704+ df['xe4'].fillna(0, inplace=True)
8705+ df['xe5'] = ta.EMA(df['xe4'], timeperiod=length)
8706+ df['xe5'].fillna(0, inplace=True)
8707+ df['xe6'] = ta.EMA(df['xe5'], timeperiod=length)
8708+ df['xe6'].fillna(0, inplace=True)
8709+ b = 0.7
8710+ c1 = -b * b * b
8711+ c2 = 3 * b * b + 3 * b * b * b
8712+ c3 = -6 * b * b - 3 * b - 3 * b * b * b
8713+ c4 = 1 + 3 * b + b * b * b + 3 * b * b
8714+ df['T3Average'] = c1 * df['xe6'] + c2 * df['xe5'] + c3 * df['xe4'] + c4 * df['xe3']
8715+
8716+ return df['T3Average']
8717+
86418718def pivot_points(dataframe: DataFrame, mode = 'fibonacci') -> Series:
86428719 hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3
86438720 hl_range = (dataframe['high'] - dataframe['low']).shift(1)
0 commit comments