Calcul 20250101-20250714 1024.828 229 max 13 ETH 11 DOGE
This commit is contained in:
@@ -1097,16 +1097,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.003)
|
||||
lim = - pct - (count_of_buys * 0.001)
|
||||
#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:
|
||||
# lim = self.calculatePctSliding(pair, last_candle)
|
||||
pct = 0.025
|
||||
# lim = - pct - (count_of_buys * 0.001)
|
||||
lim = self.getLimitBuy(pair, last_candle, pct)
|
||||
pct = 0.05
|
||||
lim = - pct - (count_of_buys * 0.001)
|
||||
#lim = self.getLimitBuy(pair, last_candle, pct)
|
||||
|
||||
if (len(dataframe) < 1):
|
||||
print("skip dataframe")
|
||||
@@ -1384,15 +1383,25 @@ 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é
|
||||
|
||||
# last_candle['max60_1d'] - last_candle['min60_1d']
|
||||
last_max = self.pairs[pair]['last_max']
|
||||
last_min = self.pairs[pair]['last_min']
|
||||
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']
|
||||
|
||||
ecart = 1
|
||||
if (last_max > 0 and last_min > 0):
|
||||
ecart = 1 + (last_max - last_min) / last_max
|
||||
last_max = last_candle['max12_1d']
|
||||
pct = 5
|
||||
if last_max > 0:
|
||||
pct = 100 * (last_max - first_price) / last_max
|
||||
|
||||
adjusted_stake_amount = base_stake_amount * ecart
|
||||
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))
|
||||
#
|
||||
# factor = self.multi_step_interpolate(pct, self.thresholds, self.factors)
|
||||
|
||||
return adjusted_stake_amount
|
||||
|
||||
@@ -1440,12 +1449,11 @@ 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
|
||||
|
||||
expected_profit = pct_to_max # 0.004 + 0.002 * self.pairs[pair]['count_of_buys'] #min(0.01, first_max)
|
||||
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)
|
||||
|
||||
# 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}")
|
||||
@@ -1963,7 +1971,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
||||
|
||||
limit = 3
|
||||
|
||||
if pair.startswith('BTC') or self.pairs[pair]['count_of_buys'] == 0:
|
||||
if pair.startswith('BTC'):
|
||||
return True # BTC toujours autorisé
|
||||
|
||||
# Filtrer les paires non-BTC
|
||||
@@ -1979,7 +1987,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
||||
max_pair = p
|
||||
total_non_btc += self.pairs[p]['count_of_buys']
|
||||
|
||||
pct_max = self.getPctLastBuy(pair, last_candle)
|
||||
pct_max = self.getPctFirstBuy(pair, last_candle) #self.getPctLastBuy(pair, last_candle)
|
||||
|
||||
# val = self.getProbaHausse(last_candle)
|
||||
# if (val < 40):
|
||||
@@ -1993,21 +2001,7 @@ class Zeus_8_3_2_B_4_2(IStrategy):
|
||||
|
||||
self.should_enter_trade_count = 0
|
||||
|
||||
# if last_candle['mid_smooth_1h_deriv1'] < -0.15 and last_candle['mid_smooth_1h_deriv2'] <= -0.15:
|
||||
# return False
|
||||
#
|
||||
# if last_candle['sma20_deriv1_1d'] < -0.08 and last_candle['sma5_deriv1_1d'] <= -0.1:
|
||||
# return False
|
||||
#
|
||||
# if (self.pairs[pair]['count_of_buys'] >= 5):
|
||||
# val = self.getProbaHausseSma5d(last_candle)
|
||||
# if (val < 30):
|
||||
# return False
|
||||
|
||||
if last_candle['sma5_deriv1_1d'] < -0.1:
|
||||
return False
|
||||
|
||||
if max_pair != '' :
|
||||
return max_pair == pair
|
||||
return max_pair == pair or pct_max < - 0.25
|
||||
else:
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user