Calcul 20240101-20250714 4061.673 280.29$ Max 8

This commit is contained in:
Jérôme Delacotte
2025-07-23 20:52:36 +02:00
parent b0a22e61c5
commit 77e7f797fe
2 changed files with 3312 additions and 2710 deletions

View File

@@ -1101,15 +1101,15 @@ class Zeus_8_3_2_B_4_2(IStrategy):
pct_max = - pct
if pair in ('BTC/USDT', 'BTC/USDC') or count_of_buys <= 2:
lim = - pct - (count_of_buys * 0.001)
lim = - pct - (count_of_buys * 0.003)
#lim = self.getLimitBuy(pair, last_candle, pct)
# lim = - (0.012 * (1 + round(count_of_buys / 5)) + 0.001 * (count_of_buys - 1))
# lim = - (0.012 + 0.001 * (count_of_buys - 1) + (0.002 * count_of_buys if count_of_buys > 10 else 0.001 * count_of_buys if count_of_buys > 5 else 0))
else:
pct = 0.05
lim = - pct - (count_of_buys * 0.005)
#lim = self.getLimitBuy(pair, last_candle, pct)
pct = 0.025
# lim = - pct - (count_of_buys * 0.001)
lim = self.getLimitBuy(pair, last_candle, pct)
if (len(dataframe) < 1):
print("skip dataframe")
@@ -1387,21 +1387,34 @@ class Zeus_8_3_2_B_4_2(IStrategy):
# Calculer le minimum des 14 derniers jours
base_stake_amount = self.config.get('stake_amount') # Montant de base configuré
if not pair in ('BTC/USDT', 'BTC/USDC'):
# factors = [1, 1.2, 1.3, 1.4]
adjusted_stake_amount = base_stake_amount
else :
first_price = self.pairs[pair]['first_buy']
if (first_price == 0):
first_price = last_candle['close']
# last_candle['max60_1d'] - last_candle['min60_1d']
last_max = self.pairs[pair]['last_max']
last_min = self.pairs[pair]['last_min']
last_max = last_candle['max12_1d']
pct = 5
if last_max > 0:
pct = 100 * (last_max - first_price) / last_max
ecart = 1
if (last_max > 0 and last_min > 0):
ecart = 1 + (last_max - last_min) / last_max
factor = self.multi_step_interpolate(pct, self.thresholds, self.factors)
adjusted_stake_amount = base_stake_amount * factor # max(base_stake_amount, min(100, base_stake_amount * percent_4))
adjusted_stake_amount = base_stake_amount * ecart
# if not pair in ('BTC/USDT', 'BTC/USDC'):
# # factors = [1, 1.2, 1.3, 1.4]
# adjusted_stake_amount = base_stake_amount
# else :
# # full = self.wallets.get_total_stake_amount()
# # base_stake_amount = min(100, full / self.stakes)
#
# first_price = self.pairs[pair]['first_buy']
# if (first_price == 0):
# first_price = last_candle['close']
#
# last_max = last_candle['max12_1d']
# pct = 5
# if last_max > 0:
# pct = 100 * (last_max - first_price) / last_max
#
# factor = self.multi_step_interpolate(pct, self.thresholds, self.factors)
# adjusted_stake_amount = base_stake_amount * factor # max(base_stake_amount, min(100, base_stake_amount * percent_4))
# pct = 100 * abs(self.getPctFirstBuy(pair, last_candle))
#
@@ -1453,11 +1466,12 @@ class Zeus_8_3_2_B_4_2(IStrategy):
return out_max - position * (out_max - out_min)
def expectedProfit(self, pair: str, last_candle: DataFrame):
pct_to_max = 0.004
max_60 = last_candle['max60_1d']
if last_candle['close'] < max_60:
pct_to_max = 0.25 * (max_60 - last_candle['close']) / max_60
count_of_buys = self.pairs[pair]['count_of_buys']
pct_first = self.getPctFirstBuy(pair, last_candle)
expected_profit = max(0.004, abs(pct_first / 3)) # 0.004 + 0.002 * self.pairs[pair]['count_of_buys'] #min(0.01, first_max)
expected_profit = pct_to_max # 0.004 + 0.002 * self.pairs[pair]['count_of_buys'] #min(0.01, first_max)
# print(
# f"Expected profit price={current_price:.4f} min_max={min_max:.4f} min_14={min_14_days:.4f} max_14={max_14_days:.4f} percent={percent:.4f} expected_profit={expected_profit:.4f}")
@@ -1975,11 +1989,11 @@ class Zeus_8_3_2_B_4_2(IStrategy):
limit = 3
if pair.startswith('BTC'):
if pair.startswith('BTC') or self.pairs[pair]['count_of_buys'] == 0:
return True # BTC toujours autorisé
# Filtrer les paires non-BTC
non_btc_pairs = [p for p in self.pairs if not p.startswith('BTC')]
non_btc_pairs = [p for p in self.pairs] # if not p.startswith('BTC')]
# Compter les positions actives sur les paires non-BTC
max_nb_trades = 0
@@ -1991,11 +2005,11 @@ class Zeus_8_3_2_B_4_2(IStrategy):
max_pair = p
total_non_btc += self.pairs[p]['count_of_buys']
pct_max = self.getPctFirstBuy(pair, last_candle) #self.getPctLastBuy(pair, last_candle)
pct_max = self.getPctLastBuy(pair, last_candle)
val = self.getProbaHausseSma5d(last_candle)
if (val < 15):
return False
# val = self.getProbaHausse(last_candle)
# if (val < 40):
# return False
# if count_decrease == len(non_btc_pairs):
# self.should_enter_trade_count += 1
@@ -2006,6 +2020,6 @@ class Zeus_8_3_2_B_4_2(IStrategy):
self.should_enter_trade_count = 0
if max_pair != '' :
return max_pair == pair or pct_max < - 0.25
return (max_pair == pair and self.pairs[pair]['count_of_buys'] <= 5) or pct_max < - 0.1
else:
return True

File diff suppressed because it is too large Load Diff