Calcul 20240101-20250714 4061.673 280.29$ Max 8
This commit is contained in:
@@ -1101,15 +1101,15 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
pct_max = - pct
|
pct_max = - pct
|
||||||
|
|
||||||
if pair in ('BTC/USDT', 'BTC/USDC') or count_of_buys <= 2:
|
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 = self.getLimitBuy(pair, last_candle, pct)
|
||||||
# lim = - (0.012 * (1 + round(count_of_buys / 5)) + 0.001 * (count_of_buys - 1))
|
# 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))
|
# 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:
|
else:
|
||||||
pct = 0.05
|
pct = 0.025
|
||||||
lim = - pct - (count_of_buys * 0.005)
|
# lim = - pct - (count_of_buys * 0.001)
|
||||||
#lim = self.getLimitBuy(pair, last_candle, pct)
|
lim = self.getLimitBuy(pair, last_candle, pct)
|
||||||
|
|
||||||
if (len(dataframe) < 1):
|
if (len(dataframe) < 1):
|
||||||
print("skip dataframe")
|
print("skip dataframe")
|
||||||
@@ -1387,21 +1387,34 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
# Calculer le minimum des 14 derniers jours
|
# Calculer le minimum des 14 derniers jours
|
||||||
base_stake_amount = self.config.get('stake_amount') # Montant de base configuré
|
base_stake_amount = self.config.get('stake_amount') # Montant de base configuré
|
||||||
|
|
||||||
if not pair in ('BTC/USDT', 'BTC/USDC'):
|
# last_candle['max60_1d'] - last_candle['min60_1d']
|
||||||
# factors = [1, 1.2, 1.3, 1.4]
|
last_max = self.pairs[pair]['last_max']
|
||||||
adjusted_stake_amount = base_stake_amount
|
last_min = self.pairs[pair]['last_min']
|
||||||
else :
|
|
||||||
first_price = self.pairs[pair]['first_buy']
|
|
||||||
if (first_price == 0):
|
|
||||||
first_price = last_candle['close']
|
|
||||||
|
|
||||||
last_max = last_candle['max12_1d']
|
ecart = 1
|
||||||
pct = 5
|
if (last_max > 0 and last_min > 0):
|
||||||
if last_max > 0:
|
ecart = 1 + (last_max - last_min) / last_max
|
||||||
pct = 100 * (last_max - first_price) / last_max
|
|
||||||
|
|
||||||
factor = self.multi_step_interpolate(pct, self.thresholds, self.factors)
|
adjusted_stake_amount = base_stake_amount * ecart
|
||||||
adjusted_stake_amount = base_stake_amount * factor # max(base_stake_amount, min(100, base_stake_amount * percent_4))
|
|
||||||
|
# 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))
|
# 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)
|
return out_max - position * (out_max - out_min)
|
||||||
|
|
||||||
def expectedProfit(self, pair: str, last_candle: DataFrame):
|
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']
|
expected_profit = pct_to_max # 0.004 + 0.002 * self.pairs[pair]['count_of_buys'] #min(0.01, first_max)
|
||||||
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)
|
|
||||||
|
|
||||||
# print(
|
# 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}")
|
# 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
|
limit = 3
|
||||||
|
|
||||||
if pair.startswith('BTC'):
|
if pair.startswith('BTC') or self.pairs[pair]['count_of_buys'] == 0:
|
||||||
return True # BTC toujours autorisé
|
return True # BTC toujours autorisé
|
||||||
|
|
||||||
# Filtrer les paires non-BTC
|
# 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
|
# Compter les positions actives sur les paires non-BTC
|
||||||
max_nb_trades = 0
|
max_nb_trades = 0
|
||||||
@@ -1991,11 +2005,11 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
|||||||
max_pair = p
|
max_pair = p
|
||||||
total_non_btc += self.pairs[p]['count_of_buys']
|
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)
|
# val = self.getProbaHausse(last_candle)
|
||||||
if (val < 15):
|
# if (val < 40):
|
||||||
return False
|
# return False
|
||||||
|
|
||||||
# if count_decrease == len(non_btc_pairs):
|
# if count_decrease == len(non_btc_pairs):
|
||||||
# self.should_enter_trade_count += 1
|
# 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
|
self.should_enter_trade_count = 0
|
||||||
|
|
||||||
if max_pair != '' :
|
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:
|
else:
|
||||||
return True
|
return True
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user