Skip to content

Commit e98910c

Browse files
committed
Buy 3: rework.
1 parent f441e81 commit e98910c

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

NostalgiaForInfinityNext.py

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -294,22 +294,22 @@ class NostalgiaForInfinityNext(IStrategy):
294294
"close_under_pivot_offset" : 1.0
295295
},
296296
3: {
297-
"ema_fast" : True,
297+
"ema_fast" : False,
298298
"ema_fast_len" : "100",
299-
"ema_slow" : True,
299+
"ema_slow" : False,
300300
"ema_slow_len" : "100",
301301
"close_above_ema_fast" : False,
302302
"close_above_ema_fast_len" : "200",
303303
"close_above_ema_slow" : False,
304304
"close_above_ema_slow_len" : "200",
305305
"sma200_rising" : False,
306-
"sma200_rising_val" : "50",
306+
"sma200_rising_val" : "30",
307307
"sma200_1h_rising" : False,
308-
"sma200_1h_rising_val" : "50",
309-
"safe_dips" : True,
308+
"sma200_1h_rising_val" : "36",
309+
"safe_dips" : False,
310310
"safe_dips_type" : "70",
311311
"safe_pump" : True,
312-
"safe_pump_type" : "100",
312+
"safe_pump_type" : "110",
313313
"safe_pump_period" : "36",
314314
"btc_1h_not_downtrend" : False,
315315
"close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
@@ -1622,11 +1622,14 @@ class NostalgiaForInfinityNext(IStrategy):
16221622
buy_2_r_480_1h_max = -10.0
16231623
buy_2_volume = 2.0
16241624

1625-
buy_bb40_bbdelta_close_3 = 0.045
1626-
buy_bb40_closedelta_close_3 = 0.023
1627-
buy_bb40_tail_bbdelta_3 = 0.418
1628-
buy_ema_rel_3 = 0.986
1629-
buy_cti_3 = -0.5
1625+
buy_3_bb40_bbdelta_close = 0.057
1626+
buy_3_bb40_closedelta_close = 0.023
1627+
buy_3_bb40_tail_bbdelta = 0.418
1628+
buy_3_cti_max = -0.5
1629+
buy_3_cci_36_osc_min = -0.25
1630+
buy_3_crsi_1h_min = 20.0
1631+
buy_3_r_480_1h_min = -48.0
1632+
buy_3_cti_1h_max = 0.82
16301633

16311634
buy_bb20_close_bblowerband_4 = 0.979
16321635
buy_bb20_volume_4 = 10.0
@@ -3708,12 +3711,12 @@ def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', curre
37083711
return f"{signal_name} ( {buy_tag} )"
37093712

37103713
# Stoplosses
3711-
if any(c in ['1', '2', '3', '4', '5', '6', '8', '9', '10', '13', '14', '15', '16', '17', '18', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48'] for c in buy_tags):
3714+
if any(c in ['1', '2', '4', '5', '6', '8', '9', '10', '13', '14', '15', '16', '17', '18', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48'] for c in buy_tags):
37123715
sell, signal_name = self.sell_stoploss_atr(current_profit, last_candle, previous_candle_1, trade, current_time)
37133716
if sell and (signal_name is not None):
37143717
return f"{signal_name} ( {buy_tag} )"
37153718

3716-
if all(c in ['7', '11', '12', '19'] for c in buy_tags):
3719+
if all(c in ['3', '7', '11', '12', '19'] for c in buy_tags):
37173720
sell, signal_name = self.sell_stoploss_extra(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)
37183721
if sell and (signal_name is not None):
37193722
return f"{signal_name} ( {buy_tag} )"
@@ -4469,16 +4472,18 @@ def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
44694472
# Condition #3
44704473
elif index == 3:
44714474
# Non-Standard protections
4472-
item_buy_logic.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3))
44734475

44744476
# Logic
44754477
item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))
4476-
item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3))
4477-
item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3))
4478-
item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3))
4478+
item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_3_bb40_bbdelta_close))
4479+
item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_3_bb40_closedelta_close))
4480+
item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_3_bb40_tail_bbdelta))
44794481
item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))
44804482
item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))
4481-
item_buy_logic.append(dataframe['cti'] < self.buy_cti_3)
4483+
item_buy_logic.append(dataframe['cci_36_osc'] > self.buy_3_cci_36_osc_min)
4484+
item_buy_logic.append(dataframe['crsi_1h'] > self.buy_3_crsi_1h_min)
4485+
item_buy_logic.append(dataframe['r_480_1h'] > self.buy_3_r_480_1h_min)
4486+
item_buy_logic.append(dataframe['cti_1h'] < self.buy_3_cti_1h_max)
44824487

44834488
# Condition #4
44844489
elif index == 4:

0 commit comments

Comments
 (0)