Compare commits
4 Commits
8b581e5a39
...
0f8b1a7c22
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0f8b1a7c22 | ||
|
|
b25d6f5759 | ||
|
|
a26460cf10 | ||
|
|
074205cc09 |
@@ -104,19 +104,23 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
},
|
},
|
||||||
"subplots": {
|
"subplots": {
|
||||||
"Rsi": {
|
"Rsi": {
|
||||||
"rsi_1h": {
|
"max_rsi_24": {
|
||||||
"color": "red"
|
|
||||||
},
|
|
||||||
"rsi_1d": {
|
|
||||||
"color": "blue"
|
"color": "blue"
|
||||||
|
}
|
||||||
|
# "rsi_1h": {
|
||||||
|
# "color": "red"
|
||||||
|
# },
|
||||||
|
# "rsi_1d": {
|
||||||
|
# "color": "blue"
|
||||||
|
# }
|
||||||
},
|
},
|
||||||
"Rsi_deriv1": {
|
"Rsi_deriv1": {
|
||||||
"rsi_deriv1_1h": {
|
# "rsi_deriv1_1h": {
|
||||||
"color": "red"
|
# "color": "red"
|
||||||
},
|
# },
|
||||||
"rsi_deriv1_1d": {
|
# "rsi_deriv1_1d": {
|
||||||
"color": "blue"
|
# "color": "blue"
|
||||||
},
|
# },
|
||||||
"sma60_deriv1": {
|
"sma60_deriv1": {
|
||||||
"color": "green"
|
"color": "green"
|
||||||
}
|
}
|
||||||
@@ -131,34 +135,6 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
"sma60_deriv2": {
|
"sma60_deriv2": {
|
||||||
"color": "green"
|
"color": "green"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
# "Down": {
|
|
||||||
# "down_count_1h": {
|
|
||||||
# "color": "green"
|
|
||||||
# },
|
|
||||||
# "up_count_1h": {
|
|
||||||
# "color": "blue"
|
|
||||||
# }
|
|
||||||
# },
|
|
||||||
# "Diff": {
|
|
||||||
# "sma10_deriv1": {
|
|
||||||
# "color": "#74effc"
|
|
||||||
# }
|
|
||||||
# },
|
|
||||||
# "smooth": {
|
|
||||||
# 'sma60_deriv1': {
|
|
||||||
# "color": "blue"
|
|
||||||
# },
|
|
||||||
# # 'mid_smooth_1h_deriv1': {
|
|
||||||
# # "color": "red"
|
|
||||||
# # },
|
|
||||||
# 'sma5_deriv2_1h': {
|
|
||||||
# "color": "pink"
|
|
||||||
# },
|
|
||||||
# # 'mid_smooth_1h_deriv2': {
|
|
||||||
# # "color": "#da59a6"
|
|
||||||
# # }
|
|
||||||
# }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -224,7 +200,8 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
# optimize=True, load=True)
|
# optimize=True, load=True)
|
||||||
sma5_deriv1_1d_restart_protection = DecimalParameter(0, 5, default=0.5, decimals=1, space='protection',
|
sma5_deriv1_1d_restart_protection = DecimalParameter(0, 5, default=0.5, decimals=1, space='protection',
|
||||||
optimize=True, load=True)
|
optimize=True, load=True)
|
||||||
sma5_deriv2_1d_restart_protection = DecimalParameter(0, 5, default=0.5, decimals=1, space='protection', optimize=True,
|
sma5_deriv2_1d_restart_protection = DecimalParameter(0, 5, default=0.5, decimals=1, space='protection',
|
||||||
|
optimize=True,
|
||||||
load=True)
|
load=True)
|
||||||
|
|
||||||
mise_factor_buy = DecimalParameter(0.01, 0.2, default=0.05, decimals=2, space='buy', optimize=True, load=True)
|
mise_factor_buy = DecimalParameter(0.01, 0.2, default=0.05, decimals=2, space='buy', optimize=True, load=True)
|
||||||
@@ -320,7 +297,8 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
# val = self.getProbaHausse144(last_candle)
|
# val = self.getProbaHausse144(last_candle)
|
||||||
|
|
||||||
# allow_to_buy = True #(not self.stop_all) #& (not self.all_down)
|
# allow_to_buy = True #(not self.stop_all) #& (not self.all_down)
|
||||||
allow_to_buy = not self.pairs[pair]['stop'] # and val > self.buy_val.value #not last_candle['tendency'] in ('B-', 'B--') # (rate <= float(limit)) | (entry_tag == 'force_entry')
|
allow_to_buy = not self.pairs[pair][
|
||||||
|
'stop'] # and val > self.buy_val.value #not last_candle['tendency'] in ('B-', 'B--') # (rate <= float(limit)) | (entry_tag == 'force_entry')
|
||||||
|
|
||||||
# if allow_to_buy:
|
# if allow_to_buy:
|
||||||
# poly_func, x_future, y_future, count = self.polynomial_forecast(
|
# poly_func, x_future, y_future, count = self.polynomial_forecast(
|
||||||
@@ -457,7 +435,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
max_profit = self.pairs[pair]['max_profit']
|
max_profit = self.pairs[pair]['max_profit']
|
||||||
baisse = 0
|
baisse = 0
|
||||||
if profit > 0:
|
if profit > 0:
|
||||||
baisse = max_profit - profit
|
baisse = 1 - (profit / max_profit)
|
||||||
mx = max_profit / 5
|
mx = max_profit / 5
|
||||||
self.pairs[pair]['count_of_buys'] = count_of_buys
|
self.pairs[pair]['count_of_buys'] = count_of_buys
|
||||||
self.pairs[pair]['current_profit'] = profit
|
self.pairs[pair]['current_profit'] = profit
|
||||||
@@ -500,11 +478,9 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
# self.pairs[pair]['force_sell'] = False
|
# self.pairs[pair]['force_sell'] = False
|
||||||
# return 'Force' + pair_name + '_' + str(count_of_buys) + '_' + str(self.pairs[pair]['has_gain'])
|
# return 'Force' + pair_name + '_' + str(count_of_buys) + '_' + str(self.pairs[pair]['has_gain'])
|
||||||
|
|
||||||
# if profit > - 2 and last_candle['rsi_1h'] < 50 \
|
if profit > 0.5 * count_of_buys and baisse > 0.15:
|
||||||
# and (last_candle['sma20'] - before_last_candle['sma20'] < 0) \
|
self.pairs[pair]['force_sell'] = False
|
||||||
# and (last_candle['rsi_deriv1_1h'] < -4 and last_candle['rsi_deriv2_1h'] < -4) :
|
return str(count_of_buys) + '_' + 'Bas_' + pair_name + '_' + str(self.pairs[pair]['has_gain'])
|
||||||
# self.pairs[pair]['force_sell'] = False
|
|
||||||
# return 'stoploss_' + pair_name + '_' + str(count_of_buys) + '_' + str(self.pairs[pair]['has_gain'])
|
|
||||||
|
|
||||||
factor = 1
|
factor = 1
|
||||||
if (self.getShortName(pair) == 'BTC'):
|
if (self.getShortName(pair) == 'BTC'):
|
||||||
@@ -515,14 +491,14 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
# return 'Baisse_' + pair_name + '_' + str(count_of_buys) + '_' + str(self.pairs[pair]['has_gain'])
|
# return 'Baisse_' + pair_name + '_' + str(count_of_buys) + '_' + str(self.pairs[pair]['has_gain'])
|
||||||
#
|
#
|
||||||
# if 1 <= count_of_buys <= 3:
|
# if 1 <= count_of_buys <= 3:
|
||||||
if last_candle['max_rsi_24'] > 75 and profit > expected_profit and (last_candle['hapercent'] < 0) :
|
if last_candle['max_rsi_24'] > 75 and profit > expected_profit and (last_candle['hapercent'] < 0) and last_candle['sma60_deriv1'] < 0:
|
||||||
self.pairs[pair]['force_sell'] = False
|
self.pairs[pair]['force_sell'] = False
|
||||||
return str(count_of_buys) + '_' + 'Rsi_' + pair_name + '_' + str(self.pairs[pair]['has_gain'])
|
return str(count_of_buys) + '_' + 'Rsi_' + pair_name + '_' + str(self.pairs[pair]['has_gain'])
|
||||||
|
|
||||||
if last_candle['mid_smooth_1h_deriv1'] < 0 and last_candle['rsi_1h'] < 50 and profit > expected_profit:
|
# if last_candle['mid_smooth_1h_deriv1'] < 0 and profit > expected_profit:
|
||||||
self.pairs[pair]['force_sell'] = False
|
# self.pairs[pair]['force_sell'] = False
|
||||||
self.pairs[pair]['force_buy'] = (self.pairs[pair]['count_of_buys'] - self.pairs[pair]['has_gain'] > 5)
|
# self.pairs[pair]['force_buy'] = (self.pairs[pair]['count_of_buys'] - self.pairs[pair]['has_gain'] > 5)
|
||||||
return str(count_of_buys) + '_' + 'Drv3_' + pair_name + '_' + str(self.pairs[pair]['has_gain'])
|
# return str(count_of_buys) + '_' + 'Drv3_' + pair_name + '_' + str(self.pairs[pair]['has_gain'])
|
||||||
|
|
||||||
# if 4 <= count_of_buys <= 6:
|
# if 4 <= count_of_buys <= 6:
|
||||||
# if ((before_last_candle_2['mid_smooth_12_deriv1'] <= before_last_candle['mid_smooth_12_deriv1'])
|
# if ((before_last_candle_2['mid_smooth_12_deriv1'] <= before_last_candle['mid_smooth_12_deriv1'])
|
||||||
@@ -590,11 +566,11 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
if self.columns_logged % 10 == 0:
|
if self.columns_logged % 10 == 0:
|
||||||
self.printLog(
|
self.printLog(
|
||||||
f"| {'Date':<16} | {'Action':<10} |{'Pair':<5}| {'Trade Type':<18} |{'Rate':>8} | {'Dispo':>6} | {'Profit':>8} | {'Pct':>6} | {'max_touch':>11} | {'last_lost':>12} | {'last_max':>7}| {'last_max':>7}|{'Buys':>5}| {'Stake':>5} |"
|
f"| {'Date':<16} | {'Action':<10} |{'Pair':<5}| {'Trade Type':<18} |{'Rate':>8} | {'Dispo':>6} | {'Profit':>8} | {'Pct':>6} | {'max_touch':>11} | {'last_lost':>12} | {'last_max':>7}| {'last_max':>7}|{'Buys':>5}| {'Stake':>5} |"
|
||||||
f"Tdc|{'val':>6}|Distmax|s201d|s5_1d|s5_2d|s51h|s52h|smt1h|smt2h|"
|
f"Tdc|{'rsi':>6}|Distmax|s201d|s5_1d|s5_2d|s51h|s52h|smt1h|smt2h|"
|
||||||
)
|
)
|
||||||
self.printLineLog()
|
self.printLineLog()
|
||||||
df = pd.DataFrame.from_dict(self.pairs, orient='index')
|
df = pd.DataFrame.from_dict(self.pairs, orient='index')
|
||||||
colonnes_a_exclure = ['last_candle', 'last_trade', 'last_palier_index', 'current_trade',
|
colonnes_a_exclure = ['last_candle', 'last_trade', 'last_palier_index', #'current_trade',
|
||||||
'trade_info', 'last_date', 'last_count_of_buys', 'base_stake_amount', 'stop_buy']
|
'trade_info', 'last_date', 'last_count_of_buys', 'base_stake_amount', 'stop_buy']
|
||||||
df_filtered = df[df['count_of_buys'] > 0].drop(columns=colonnes_a_exclure)
|
df_filtered = df[df['count_of_buys'] > 0].drop(columns=colonnes_a_exclure)
|
||||||
# df_filtered = df_filtered["first_buy", "last_max", "max_touch", "last_sell","last_buy", 'count_of_buys', 'current_profit']
|
# df_filtered = df_filtered["first_buy", "last_max", "max_touch", "last_sell","last_buy", 'count_of_buys', 'current_profit']
|
||||||
@@ -661,8 +637,10 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
color_smooth_1h = GREEN if last_candle['mid_smooth_1h_deriv1'] > 0 else RED
|
color_smooth_1h = GREEN if last_candle['mid_smooth_1h_deriv1'] > 0 else RED
|
||||||
color_smooth2_1h = GREEN if last_candle['mid_smooth_1h_deriv2'] > 0 else RED
|
color_smooth2_1h = GREEN if last_candle['mid_smooth_1h_deriv2'] > 0 else RED
|
||||||
|
|
||||||
last_max = int(self.pairs[pair]['last_max']) if self.pairs[pair]['last_max'] > 1 else round(self.pairs[pair]['last_max'],3)
|
last_max = int(self.pairs[pair]['last_max']) if self.pairs[pair]['last_max'] > 1 else round(
|
||||||
last_min = int(self.pairs[pair]['last_min']) if self.pairs[pair]['last_min'] > 1 else round(self.pairs[pair]['last_min'], 3)
|
self.pairs[pair]['last_max'], 3)
|
||||||
|
last_min = int(self.pairs[pair]['last_min']) if self.pairs[pair]['last_min'] > 1 else round(
|
||||||
|
self.pairs[pair]['last_min'], 3)
|
||||||
|
|
||||||
profit = str(profit) + '/' + str(round(self.pairs[pair]['max_profit'], 2))
|
profit = str(profit) + '/' + str(round(self.pairs[pair]['max_profit'], 2))
|
||||||
|
|
||||||
@@ -679,7 +657,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
f"|{last_candle['tendency_12'] or '-':>3}|" # {last_candle['tendency_1h'] or '-':>3}|{last_candle['tendency_1d'] or '-':>3}"
|
f"|{last_candle['tendency_12'] or '-':>3}|" # {last_candle['tendency_1h'] or '-':>3}|{last_candle['tendency_1d'] or '-':>3}"
|
||||||
# f"|{round(last_candle['mid_smooth_24_deriv1'],3) or '-':>6}|{round(last_candle['mid_smooth_1h_deriv1'],3) or '-':>6}|{round(last_candle['mid_smooth_deriv1_1d'],3) or '-' :>6}|"
|
# f"|{round(last_candle['mid_smooth_24_deriv1'],3) or '-':>6}|{round(last_candle['mid_smooth_1h_deriv1'],3) or '-':>6}|{round(last_candle['mid_smooth_deriv1_1d'],3) or '-' :>6}|"
|
||||||
# f"{round(last_candle['mid_smooth_24_deriv2'],3) or '-' :>6}|{round(last_candle['mid_smooth_1h_deriv2'],3) or '-':>6}|{round(last_candle['mid_smooth_deriv2_1d'],3) or '-':>6}|"
|
# f"{round(last_candle['mid_smooth_24_deriv2'],3) or '-' :>6}|{round(last_candle['mid_smooth_1h_deriv2'],3) or '-':>6}|{round(last_candle['mid_smooth_deriv2_1d'],3) or '-':>6}|"
|
||||||
f"{round(val, 1) or '-' :>6}|"
|
f"{round(last_candle['max_rsi_24'], 1) or '-' :>6}|"
|
||||||
f"{dist_max:>7}|{color_sma20}{round(last_candle['sma20_deriv1_1d'], 2):>5}{RESET}"
|
f"{dist_max:>7}|{color_sma20}{round(last_candle['sma20_deriv1_1d'], 2):>5}{RESET}"
|
||||||
f"|{color_sma5}{round(last_candle['mid_smooth_5_deriv1_1d'], 2):>5}{RESET}|{color_sma5_2}{round(last_candle['mid_smooth_5_deriv2_1d'], 2):>5}{RESET}"
|
f"|{color_sma5}{round(last_candle['mid_smooth_5_deriv1_1d'], 2):>5}{RESET}|{color_sma5_2}{round(last_candle['mid_smooth_5_deriv2_1d'], 2):>5}{RESET}"
|
||||||
f"|{color_sma5_1h}{round(last_candle['sma60_deriv1'], 2):>5}{RESET}|{color_sma5_2h}{round(last_candle['sma60_deriv2'], 2):>5}{RESET}"
|
f"|{color_sma5_1h}{round(last_candle['sma60_deriv1'], 2):>5}{RESET}|{color_sma5_2h}{round(last_candle['sma60_deriv2'], 2):>5}{RESET}"
|
||||||
@@ -893,13 +871,13 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
# self.calculateStats(informative, 'sma5_deriv1', 'futur_percent_3')
|
# self.calculateStats(informative, 'sma5_deriv1', 'futur_percent_3')
|
||||||
|
|
||||||
if self.dp.runmode.value in ('backtest'):
|
if self.dp.runmode.value in ('backtest'):
|
||||||
informative['futur_percent'] = 100 * (informative['close'].shift(-1) - informative['close']) / informative['close']
|
informative['futur_percent'] = 100 * (informative['close'].shift(-1) - informative['close']) / informative[
|
||||||
|
'close']
|
||||||
# informative['futur_percent_3d'] = 100 * (informative['close'].shift(-3) - informative['close']) / informative['close']
|
# informative['futur_percent_3d'] = 100 * (informative['close'].shift(-3) - informative['close']) / informative['close']
|
||||||
#
|
#
|
||||||
# self.calculateProbabilite2Index(informative, ['futur_percent_1d'], 'rsi_deriv1', 'rsi')
|
# self.calculateProbabilite2Index(informative, ['futur_percent_1d'], 'rsi_deriv1', 'rsi')
|
||||||
# # self.calculateProbabilite2Index(dataframe, ['futur_percent_3d'], 'rsi_deriv1', 'sma5')
|
# # self.calculateProbabilite2Index(dataframe, ['futur_percent_3d'], 'rsi_deriv1', 'sma5')
|
||||||
|
|
||||||
|
|
||||||
# informative['close_smooth'] = self.conditional_smoothing(informative['mid'].dropna(), threshold=0.0015).dropna()
|
# informative['close_smooth'] = self.conditional_smoothing(informative['mid'].dropna(), threshold=0.0015).dropna()
|
||||||
# informative['smooth'], informative['deriv1'], informative['deriv2'] = self.smooth_and_derivatives(informative['close_smooth'])
|
# informative['smooth'], informative['deriv1'], informative['deriv2'] = self.smooth_and_derivatives(informative['close_smooth'])
|
||||||
# informative['deriv1'] = 100 * informative['deriv1'] / informative['mid']
|
# informative['deriv1'] = 100 * informative['deriv1'] / informative['mid']
|
||||||
@@ -1062,7 +1040,8 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
return dataframe
|
return dataframe
|
||||||
|
|
||||||
def calculeDerivees(self, dataframe, indic, factor_1=100, factor_2=10, horizon=5):
|
def calculeDerivees(self, dataframe, indic, factor_1=100, factor_2=10, horizon=5):
|
||||||
dataframe[f"{indic}_deriv1"] = (factor_1 * dataframe[f"{indic}"].diff() / dataframe[f"{indic}"]).rolling(horizon).mean()
|
dataframe[f"{indic}_deriv1"] = (factor_1 * dataframe[f"{indic}"].diff() / dataframe[f"{indic}"]).rolling(
|
||||||
|
horizon).mean()
|
||||||
dataframe[f"{indic}_deriv2"] = (factor_2 * dataframe[f"{indic}_deriv1"].diff()).rolling(horizon).mean()
|
dataframe[f"{indic}_deriv2"] = (factor_2 * dataframe[f"{indic}_deriv1"].diff()).rolling(horizon).mean()
|
||||||
|
|
||||||
def calculateDownAndUp(self, dataframe, limit=0.0001):
|
def calculateDownAndUp(self, dataframe, limit=0.0001):
|
||||||
@@ -1483,7 +1462,8 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
max_amount = self.config.get('stake_amount') * 2.5
|
max_amount = self.config.get('stake_amount') * 2.5
|
||||||
# stake_amount = min(stake_amount, self.wallets.get_available_stake_amount())
|
# stake_amount = min(stake_amount, self.wallets.get_available_stake_amount())
|
||||||
stake_amount = min(min(max_amount, self.wallets.get_available_stake_amount()),
|
stake_amount = min(min(max_amount, self.wallets.get_available_stake_amount()),
|
||||||
self.adjust_stake_amount(pair, last_candle) - 10 * pct_first / self.mise_factor_buy.value) # min(200, self.adjust_stake_amount(pair, last_candle) * self.fibo[count_of_buys])
|
self.adjust_stake_amount(pair,
|
||||||
|
last_candle) - 10 * pct_first / self.mise_factor_buy.value) # min(200, self.adjust_stake_amount(pair, last_candle) * self.fibo[count_of_buys])
|
||||||
|
|
||||||
if self.wallets.get_available_stake_amount() > stake_amount:
|
if self.wallets.get_available_stake_amount() > stake_amount:
|
||||||
trade_type = last_candle['enter_tag'] if last_candle['enter_long'] == 1 else 'pct48'
|
trade_type = last_candle['enter_tag'] if last_candle['enter_long'] == 1 else 'pct48'
|
||||||
@@ -1539,7 +1519,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
|
|
||||||
last_lost = self.getLastLost(last_candle, pair)
|
last_lost = self.getLastLost(last_candle, pair)
|
||||||
|
|
||||||
if (hours > 6
|
if (current_profit > 0 and hours > 6
|
||||||
# and last_candle['sma60_deriv1'] > 0
|
# and last_candle['sma60_deriv1'] > 0
|
||||||
and last_candle['rsi_1h'] < 65
|
and last_candle['rsi_1h'] < 65
|
||||||
and last_candle['rsi_deriv1_1h'] > 0
|
and last_candle['rsi_deriv1_1h'] > 0
|
||||||
@@ -1728,7 +1708,10 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
# if last_candle['close'] < max_60:
|
# if last_candle['close'] < max_60:
|
||||||
# pct_to_max = 0.25 * (max_60 - last_candle['close']) / max_60
|
# pct_to_max = 0.25 * (max_60 - last_candle['close']) / max_60
|
||||||
# pct_to_max = pct_to_max * (2 - pctClose60)
|
# pct_to_max = pct_to_max * (2 - pctClose60)
|
||||||
expected_profit = lim * self.pairs[pair]['total_amount'] #min(3 * lim, max(lim, pct_to_max)) # 0.004 + 0.002 * self.pairs[pair]['count_of_buys'] #min(0.01, first_max)
|
expected_profit = lim * self.pairs[pair][
|
||||||
|
'total_amount'] # min(3 * lim, max(lim, pct_to_max)) # 0.004 + 0.002 * self.pairs[pair]['count_of_buys'] #min(0.01, first_max)
|
||||||
|
|
||||||
|
self.pairs[pair]['expected_profit'] = expected_profit
|
||||||
|
|
||||||
self.pairs[pair]['expected_profit'] = expected_profit
|
self.pairs[pair]['expected_profit'] = expected_profit
|
||||||
|
|
||||||
@@ -2257,7 +2240,8 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
# if not pair.startswith('BTC'):
|
# if not pair.startswith('BTC'):
|
||||||
dispo = round(self.wallets.get_available_stake_amount())
|
dispo = round(self.wallets.get_available_stake_amount())
|
||||||
|
|
||||||
if self.pairs[pair]['stop'] and last_candle['mid_smooth_5_deriv1_1d'] > -0.9 and last_candle['sma5_deriv1_1d'] > 0 and last_candle['sma5_deriv2_1d'] > 0:
|
if self.pairs[pair]['stop'] and last_candle['mid_smooth_5_deriv1_1d'] > -0.9 and last_candle[
|
||||||
|
'sma5_deriv1_1d'] > 0 and last_candle['sma5_deriv2_1d'] > 0:
|
||||||
self.pairs[pair]['stop'] = False
|
self.pairs[pair]['stop'] = False
|
||||||
self.log_trade(
|
self.log_trade(
|
||||||
last_candle=last_candle,
|
last_candle=last_candle,
|
||||||
@@ -2272,7 +2256,8 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
stake=0
|
stake=0
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
if self.pairs[pair]['stop'] == False and (last_candle['sma5_deriv1_1d'] < -0.2 or last_candle['sma5_deriv2_1d'] < -3):
|
if self.pairs[pair]['stop'] == False and (
|
||||||
|
last_candle['sma5_deriv1_1d'] < -0.2 or last_candle['sma5_deriv2_1d'] < -3):
|
||||||
self.pairs[pair]['stop'] = True
|
self.pairs[pair]['stop'] = True
|
||||||
# if self.pairs[pair]['current_profit'] > 0:
|
# if self.pairs[pair]['current_profit'] > 0:
|
||||||
# self.pairs[pair]['force_sell'] = True
|
# self.pairs[pair]['force_sell'] = True
|
||||||
@@ -2301,7 +2286,8 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
if last_candle['sma5_deriv1_1h'] < 0.0 and last_candle['sma5_deriv2_1h'] < -0.0:
|
if last_candle['sma5_deriv1_1h'] < 0.0 and last_candle['sma5_deriv2_1h'] < -0.0:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if last_candle['mid_smooth_1h_deriv1'] < 0.0 and last_candle['mid_smooth_1h_deriv2'] < -0.0 and last_candle['sma5_deriv2_1h'] < 0:
|
if last_candle['mid_smooth_1h_deriv1'] < 0.0 and last_candle['mid_smooth_1h_deriv2'] < -0.0 and last_candle[
|
||||||
|
'sma5_deriv2_1h'] < 0:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# if pair.startswith('BTC'):
|
# if pair.startswith('BTC'):
|
||||||
|
|||||||
Reference in New Issue
Block a user